Skip to main content
GET
/
v1
/
goals
Get goals
curl --request GET \
  --url https://app.hipp.health/api/v1/goals
{
  "data": [
    {
      "publicId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "addedToTreatmentPlanAt": "2023-11-07T05:31:56Z",
      "targetAchievementDate": "2023-11-07T05:31:56Z",
      "autoProgressToMaintenanceEnabled": true,
      "autoProgressToMasteredEnabled": true,
      "treatmentPlanId": "<string>",
      "type": "<string>",
      "isBehavior": true,
      "numberOfInstances": 1,
      "goalStatement": "<string>",
      "instructions": "<string>",
      "progressSummary": "<string>",
      "definition": "<string>",
      "targetMaladaptiveBehaviorName": "<string>"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 1,
    "totalCount": 1,
    "totalPages": 1
  }
}

Get All Goals

Retrieve a paginated list of goals with optional filtering by treatment plan, type, and status.

Headers

Authorization: Bearer <your-api-key>

Query Parameters

  • page (optional): Page number (1-indexed). Default: 1. Minimum: 1
  • pageSize (optional): Number of items per page. Default: 25. Minimum: 1, Maximum: 100
  • treatmentPlanId (optional): Filter by treatment plan public ID
  • type (optional): Filter by goal type (frequency_duration, opportunity, rating, interval)
  • status (optional): Filter by goal status

Success Response (200)

{
  "data": [
    {
      "publicId": "goal_abc123",
      "type": "frequency_duration",
      "status": "IN_PROGRESS",
      "goalStatement": "Reduce aggressive behavior during transitions",
      "instructions": "Monitor and record instances during class transitions",
      "progressSummary": "Showing improvement over past 2 weeks",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-20T14:45:00Z",
      "addedToTreatmentPlanAt": "2024-01-15T10:30:00Z",
      "targetAchievementDate": "2024-06-15T00:00:00Z",
      "autoProgressToMaintenanceEnabled": false,
      "autoProgressToMasteredEnabled": false,
      "treatmentPlanId": "tp_xyz789",
      "definition": "Physical aggression including hitting, kicking, or pushing",
      "isBehavior": true,
      "targetMaladaptiveBehaviorName": "Aggression",
      "numberOfInstances": 45
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 25,
    "totalCount": 100,
    "totalPages": 4
  }
}

Error Responses

400 - Validation Error

{
  "error": "Validation error",
  "details": [
    {
      "code": "invalid_string",
      "message": "Invalid parameter value",
      "path": ["page"]
    }
  ]
}

500 - Internal Server Error

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

Examples

cURL Example

# Get all goals
curl -X GET "https://app.hipp.health/api/v1/goals?page=1&pageSize=25" \
  -H "Authorization: Bearer your-api-key"

# Get goals for a specific treatment plan
curl -X GET "https://app.hipp.health/api/v1/goals?treatmentPlanId=tp_xyz789" \
  -H "Authorization: Bearer your-api-key"

# Get frequency duration goals only
curl -X GET "https://app.hipp.health/api/v1/goals?type=frequency_duration" \
  -H "Authorization: Bearer your-api-key"

JavaScript Example

const getGoals = async (params = {}) => {
  const queryParams = new URLSearchParams(params);
  const response = await fetch(
    `https://app.hipp.health/api/v1/goals?${queryParams}`,
    {
      method: "GET",
      headers: {
        Authorization: "Bearer your-api-key",
      },
    }
  );

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

  return response.json();
};

// Usage
try {
  const result = await getGoals({
    page: 1,
    pageSize: 25,
    treatmentPlanId: "tp_xyz789",
    status: "IN_PROGRESS",
  });
  console.log("Goals:", result.data);
  console.log("Pagination:", result.pagination);
} catch (error) {
  console.error("Error fetching goals:", error.message);
}

Query Parameters

page
integer
default:1

Page number (1-indexed)

Required range: x >= 1
pageSize
integer
default:25

Number of items per page

Required range: 1 <= x <= 100
treatmentPlanId
string

Filter by treatment plan public ID

type
enum<string>

Filter by goal type

Available options:
frequency_duration,
opportunity,
rating,
interval
status
string

Filter by goal status

Response

Successful response

data
object[]
required
pagination
object
required