Skip to main content
POST
/
v1
/
goals
Create goal
curl --request POST \
  --url https://app.hipp.health/api/v1/goals \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "frequency_duration",
  "treatmentPlanId": "<string>",
  "goalStatement": "<string>",
  "baselineMetric": {
    "value": 123,
    "observationPeriod": 123
  },
  "successMetric": {
    "value": 123,
    "observationPeriod": 123
  },
  "maintenanceMetric": {
    "value": 123,
    "observationPeriod": 123
  },
  "targetAchievementDate": "2023-11-07T05:31:56Z",
  "baselineDate": "2023-11-07T05:31:56Z",
  "targetMaladaptiveBehaviorName": "<string>",
  "definition": "<string>",
  "progressSummary": "<string>",
  "instructions": "<string>",
  "autoProgressToMaintenanceEnabled": false,
  "autoProgressToMasteredEnabled": false,
  "isBehavior": false
}
'
{
  "type": "<string>",
  "publicId": "<string>",
  "addedToTreatmentPlanAt": "2023-11-07T05:31:56Z",
  "goalStatement": "<string>",
  "autoProgressToMaintenanceEnabled": true,
  "autoProgressToMasteredEnabled": true,
  "baselineMetric": {
    "publicId": "<string>",
    "value": 123,
    "observationPeriod": 123
  },
  "successMetric": {
    "publicId": "<string>",
    "value": 123,
    "observationPeriod": 123
  },
  "maintenanceMetric": {
    "publicId": "<string>",
    "value": 123,
    "observationPeriod": 123
  },
  "targetMaladaptiveBehaviorName": "<string>",
  "definition": "<string>",
  "instructions": "<string>",
  "baselineDate": "2023-11-07T05:31:56Z",
  "targetAchievementDate": "2023-11-07T05:31:56Z",
  "progressSummary": "<string>",
  "isBehavior": true,
  "behaviorInstances": [
    {
      "publicId": "<string>",
      "quantity": 123,
      "happenedAt": "2023-11-07T05:31:56Z",
      "antecedent": "<string>",
      "consequence": "<string>",
      "durationSeconds": 123
    }
  ]
}

Create Goal

Create a new goal (frequency_duration, opportunity, rating, or interval) for a treatment plan.

Headers

Authorization: Bearer <your-api-key>
Content-Type: application/json

Request Body

The request body varies based on the goal type. All goals require a type field and treatmentPlanId.

Frequency/Duration Based Goal Example

{
  "type": "frequency_duration",
  "treatmentPlanId": "tp_abc123def456",
  "goalStatement": "Reduce aggressive behavior during transitions",
  "targetMaladaptiveBehaviorName": "Aggression",
  "definition": "Physical aggression including hitting, kicking, or pushing",
  "instructions": "Monitor and record instances during class transitions",
  "status": "IN_PROGRESS",
  "targetAchievementDate": "2024-06-15T00:00:00Z",
  "baselineDate": "2024-01-15T00:00:00Z",
  "progressSummary": "Starting baseline observations",
  "autoProgressToMaintenanceEnabled": false,
  "autoProgressToMasteredEnabled": false,
  "dataCollectionType": "FREQUENCY_ONLY",
  "baselineMetric": {
    "value": 10,
    "unit": "FREQUENCY",
    "frequencyUnit": "DAYS",
    "observationPeriod": 1,
    "observationPeriodUnit": "DAYS",
    "successCriteria": "EQUAL_TO"
  },
  "successMetric": {
    "value": 2,
    "unit": "FREQUENCY",
    "frequencyUnit": "DAYS",
    "observationPeriod": 1,
    "observationPeriodUnit": "DAYS",
    "successCriteria": "LESS_THAN_OR_EQUAL_TO"
  },
  "maintenanceMetric": {
    "value": 2,
    "unit": "FREQUENCY",
    "frequencyUnit": "DAYS",
    "observationPeriod": 1,
    "observationPeriodUnit": "DAYS",
    "successCriteria": "LESS_THAN_OR_EQUAL_TO"
  }
}

Opportunity Based Goal Example

{
  "type": "opportunity",
  "treatmentPlanId": "tp_abc123def456",
  "skillAcquisitionGoalType": "CHAINED_GOAL",
  "goalStatement": "Complete hand washing sequence independently",
  "shortDescription": "Hand washing routine",
  "instructions": "Use task analysis with 8 steps",
  "skillCategory": "Self-care",
  "status": "IN_PROGRESS",
  "targetAchievementDate": "2024-01-15T00:00:00Z",
  "baselineDate": "2024-01-15T00:00:00Z",
  "minTrialsCount": 3,
  "enabledOutcomes": ["SUCCESS", "FAILURE", "PROMPTED"],
  "autoProgressToMaintenanceEnabled": false,
  "autoProgressToMasteredEnabled": false,
  "baselineMetric": {
    "value": 20,
    "unit": "PERCENTAGE",
    "successCriteria": "EQUAL_TO"
  },
  "successMetric": {
    "value": 80,
    "unit": "PERCENTAGE",
    "successCriteria": "GREATER_THAN_OR_EQUAL_TO"
  },
  "maintenanceMetric": {
    "value": 80,
    "unit": "PERCENTAGE",
    "successCriteria": "GREATER_THAN_OR_EQUAL_TO"
  },
  "childGoals": [
    {
      "skillAcquisitionGoalType": "CHAINED_GOAL_TARGET",
      "goalStatement": "Turn on water",
      "enabledOutcomes": ["SUCCESS", "FAILURE", "PROMPTED"],
      "baselineMetric": {
        "value": 0,
        "unit": "PERCENTAGE"
      },
      "successMetric": {
        "value": 80,
        "unit": "PERCENTAGE"
      },
      "maintenanceMetric": {
        "value": 80,
        "unit": "PERCENTAGE"
      }
    }
  ]
}

Rating Goal Example

{
  "type": "rating",
  "treatmentPlanId": "tp_abc123def456",
  "title": "Anxiety level during transitions",
  "description": "Rate anxiety on 1-10 scale",
  "instructions": "Observe and rate at start of each transition",
  "status": "IN_PROGRESS"
}

Interval Goal Example

{
  "type": "interval",
  "treatmentPlanId": "tp_abc123def456",
  "title": "On-task behavior",
  "description": "Track engagement during work periods",
  "instructions": "Observe at end of each interval",
  "status": "IN_PROGRESS",
  "intervalDuration": 30,
  "intervalQuantity": 10,
  "sets": 3,
  "intervalRecordingType": "WHOLE",
  "window": 5
}

Field Descriptions

Common Fields (All Goal Types)

  • type (required): Goal type - “frequency_duration”, “opportunity”, “rating”, or “interval”
  • treatmentPlanId (required): Treatment plan public identifier
  • status (optional): Goal status
  • targetAchievementDate (optional): Target date for achieving the goal
  • baselineDate (optional): Date baseline measurements began

Frequency Duration Goal Fields

  • goalStatement (required): Description of the behavioral goal
  • targetMaladaptiveBehaviorName (optional): Name of the behavior to reduce
  • definition (optional): Operational definition of the behavior
  • instructions (optional): Instructions for data collection
  • progressSummary (optional): Summary of current progress
  • autoProgressToMaintenanceEnabled (optional): Auto-progress to maintenance phase
  • autoProgressToMasteredEnabled (optional): Auto-progress to mastered status
  • dataCollectionType (optional): Type of data collection method
  • baselineMetric (required): Baseline measurement criteria
  • successMetric (required): Success criteria
  • maintenanceMetric (required): Maintenance criteria

Opportunity Goal Fields

  • skillAcquisitionGoalType (required): Type of skill acquisition
  • goalStatement (required): Description of the skill goal
  • shortDescription (optional): Brief description
  • instructions (optional): Instructions for teaching/data collection
  • skillCategory (optional): Category of skill
  • minTrialsCount (optional): Minimum number of trials per session
  • enabledOutcomes (required): Array of enabled trial outcomes
  • baselineMetric (required): Baseline measurement criteria
  • successMetric (required): Success criteria
  • maintenanceMetric (required): Maintenance criteria
  • childGoals (optional): Array of sub-goals for task analysis

Rating Goal Fields

  • title (required): Goal title
  • description (optional): Goal description
  • instructions (optional): Instructions for rating

Interval Goal Fields

  • title (required): Goal title
  • description (optional): Goal description
  • instructions (optional): Instructions for data collection
  • intervalDuration (required): Length of each interval in seconds (must be > 0)
  • intervalQuantity (required): Number of intervals per set (must be > 0)
  • sets (required): Number of sets (must be > 0)
  • intervalRecordingType (required): Type of interval recording
  • window (optional): Observation window in seconds (must be > 0)

Success Response (201)

Response varies by goal type. Example for Frequency Duration Goal:
{
  "type": "frequency_duration",
  "publicId": "goal_abc123",
  "targetMaladaptiveBehaviorName": "Aggression",
  "dataCollectionType": "FREQUENCY_ONLY",
  "addedToTreatmentPlanAt": "2024-01-15T10:30:00Z",
  "goalStatement": "Reduce aggressive behavior during transitions",
  "definition": "Physical aggression including hitting, kicking, or pushing",
  "instructions": "Monitor and record instances during class transitions",
  "status": "IN_PROGRESS",
  "baselineDate": "2024-01-15T00:00:00Z",
  "targetAchievementDate": "2024-06-15T00:00:00Z",
  "progressSummary": "Starting baseline observations",
  "autoProgressToMaintenanceEnabled": false,
  "autoProgressToMasteredEnabled": false,
  "baselineMetric": {
    "publicId": "metric_123",
    "value": 10,
    "unit": "FREQUENCY",
    "frequencyUnit": "DAYS",
    "observationPeriod": 1,
    "observationPeriodUnit": "DAYS",
    "successCriteria": "EQUAL_TO"
  },
  "successMetric": {
    "publicId": "metric_124",
    "value": 2,
    "unit": "FREQUENCY",
    "frequencyUnit": "DAYS",
    "observationPeriod": 1,
    "observationPeriodUnit": "DAYS",
    "successCriteria": "LESS_THAN_OR_EQUAL_TO"
  },
  "maintenanceMetric": {
    "publicId": "metric_125",
    "value": 2,
    "unit": "FREQUENCY",
    "frequencyUnit": "DAYS",
    "observationPeriod": 1,
    "observationPeriodUnit": "DAYS",
    "successCriteria": "LESS_THAN_OR_EQUAL_TO"
  },
  "behaviorInstances": null
}

Error Responses

400 - Validation Error

{
  "error": "Validation error",
  "details": [
    {
      "code": "invalid_string",
      "message": "Goal statement is required",
      "path": ["goalStatement"]
    }
  ]
}

500 - Internal Server Error

{
  "error": "An unexpected error occurred"
}

Examples

cURL Example

# Create a frequency duration goal
curl -X POST https://app.hipp.health/api/v1/goals \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "frequency_duration",
    "treatmentPlanId": "tp_abc123def456",
    "goalStatement": "Reduce aggressive behavior during transitions",
    "baselineMetric": {"value": 10, "unit": "FREQUENCY"},
    "successMetric": {"value": 2, "unit": "FREQUENCY"},
    "maintenanceMetric": {"value": 2, "unit": "FREQUENCY"}
  }'

JavaScript Example

const createGoal = async (goalData) => {
  const response = await fetch("https://app.hipp.health/api/v1/goals", {
    method: "POST",
    headers: {
      Authorization: "Bearer your-api-key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify(goalData),
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(error.error || "Failed to create goal");
  }

  return response.json();
};

// Usage - Create a frequency duration goal
try {
  const goal = await createGoal({
    type: "frequency_duration",
    treatmentPlanId: "tp_abc123def456",
    goalStatement: "Reduce aggressive behavior during transitions",
    baselineMetric: { value: 10, unit: "FREQUENCY" },
    successMetric: { value: 2, unit: "FREQUENCY" },
    maintenanceMetric: { value: 2, unit: "FREQUENCY" },
  });
  console.log("Goal created:", goal);
} catch (error) {
  console.error("Error creating goal:", error.message);
}

Body

application/json
type
enum<string>
required
Available options:
frequency_duration
treatmentPlanId
string
required
Minimum string length: 1
goalStatement
string
required
Minimum string length: 1
baselineMetric
object
required
successMetric
object
required
maintenanceMetric
object
required
targetAchievementDate
string<date-time> | null
baselineDate
string<date-time> | null
status
enum<string> | null
Available options:
BASELINE,
IN_MAINTENANCE,
MASTERED,
ARCHIVED,
IN_PROGRESS,
DISCONTINUED,
FUTURE,
ON_HOLD
targetMaladaptiveBehaviorName
string | null
definition
string | null
progressSummary
string | null
instructions
string | null
autoProgressToMaintenanceEnabled
boolean | null
default:false
autoProgressToMasteredEnabled
boolean | null
default:false
isBehavior
boolean | null
default:false
dataCollectionType
enum<string> | null
Available options:
FREQUENCY_ONLY,
DURATION_ONLY,
FREQUENCY_AND_DURATION

Response

Successful response

type
string
required
publicId
string
required
dataCollectionType
enum<string>
required
Available options:
FREQUENCY_ONLY,
DURATION_ONLY,
FREQUENCY_AND_DURATION
addedToTreatmentPlanAt
string<date-time>
required
goalStatement
string
required
status
enum<string>
required
Available options:
BASELINE,
IN_MAINTENANCE,
MASTERED,
ARCHIVED,
IN_PROGRESS,
DISCONTINUED,
FUTURE,
ON_HOLD
autoProgressToMaintenanceEnabled
boolean
required
autoProgressToMasteredEnabled
boolean
required
baselineMetric
object
required
successMetric
object
required
maintenanceMetric
object
required
targetMaladaptiveBehaviorName
string | null
definition
string | null
instructions
string | null
baselineDate
string<date-time> | null
targetAchievementDate
string<date-time> | null
progressSummary
string | null
isBehavior
boolean
behaviorInstances
object[] | null