Skip to main content
GET
/
v1
/
treatment-plans
Get treatment plans
curl --request GET \
  --url https://app.hipp.health/api/v1/treatment-plans
{
  "data": [
    {
      "publicId": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "patient": {
        "publicId": "<string>",
        "firstName": "<string>",
        "lastName": "<string>"
      },
      "name": "<string>"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 1,
    "totalCount": 1,
    "totalPages": 1
  }
}

Get All Treatment Plans

Retrieve a paginated list of treatment plans for your organization.

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
  • patientId (optional): Filter treatment plans by patient public ID

Success Response (200)

{
  "data": [
    {
      "publicId": "tp_abc123def456",
      "name": "Physical Therapy Treatment Plan",
      "practiceArea": "Physical Therapy",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-20T14:45:00Z",
      "patient": {
        "publicId": "usr_patient123",
        "firstName": "John",
        "lastName": "Doe"
      }
    }
  ],
  "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 treatment plans
curl -X GET "https://app.hipp.health/api/v1/treatment-plans?page=1&pageSize=25" \
  -H "Authorization: Bearer your-api-key"

# Get treatment plans for a specific patient
curl -X GET "https://app.hipp.health/api/v1/treatment-plans?patientId=usr_patient123" \
  -H "Authorization: Bearer your-api-key"

JavaScript Example

const getTreatmentPlans = async (params = {}) => {
  const queryParams = new URLSearchParams(params);
  const response = await fetch(
    `https://app.hipp.health/api/v1/treatment-plans?${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 treatment plans");
  }

  return response.json();
};

// Usage
try {
  const result = await getTreatmentPlans({
    page: 1,
    pageSize: 25,
    patientId: "usr_patient123",
  });
  console.log("Treatment Plans:", result.data);
  console.log("Pagination:", result.pagination);
} catch (error) {
  console.error("Error fetching treatment plans:", 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
patientId
string

Filter by patient public ID

Response

Successful response

data
object[]
required
pagination
object
required