> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hipp.health/llms.txt
> Use this file to discover all available pages before exploring further.

# Get All Treatment Plans

> Get paginated list of treatment plans for the authenticated organization

## 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)

```json theme={null}
{
  "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

```json theme={null}
{
  "error": "Validation error",
  "details": [
    {
      "code": "invalid_string",
      "message": "Invalid parameter value",
      "path": ["page"]
    }
  ]
}
```

#### 500 - Internal Server Error

```json theme={null}
{
  "error": "An unexpected error occurred"
}
```

## Examples

### cURL Example

```bash theme={null}
# 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

```javascript theme={null}
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);
}
```


## OpenAPI

````yaml GET /v1/treatment-plans
openapi: 3.0.0
info:
  title: Hipp Health API
  version: 1.0.0
  description: API for managing users and resources within your Hipp Health organization
servers:
  - url: https://app.hipp.health/api
    description: Production Server
security: []
paths:
  /v1/treatment-plans:
    get:
      tags:
        - V1
      summary: Get treatment plans
      description: Get paginated list of treatment plans for the authenticated organization
      operationId: get-v1-treatment-plans
      parameters:
        - in: query
          name: page
          description: Page number (1-indexed)
          schema:
            type: integer
            minimum: 1
            default: 1
          required: false
        - in: query
          name: pageSize
          description: Number of items per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          required: false
        - in: query
          name: patientId
          description: Filter by patient public ID
          schema:
            type: string
          required: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTreatmentPlansResponseSchema'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    PaginatedTreatmentPlansResponseSchema:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TreatmentPlanBaseSchema'
        pagination:
          $ref: '#/components/schemas/PaginationResponseSchema'
      required:
        - data
        - pagination
    TreatmentPlanBaseSchema:
      type: object
      properties:
        publicId:
          type: string
        name:
          type: string
          nullable: true
        practiceArea:
          $ref: '#/components/schemas/PracticeArea'
          nullable: true
        createdAt:
          type: string
        updatedAt:
          type: string
        patient:
          $ref: '#/components/schemas/TreatmentPlanPatientSchema'
      required:
        - publicId
        - createdAt
        - updatedAt
        - patient
    PaginationResponseSchema:
      type: object
      properties:
        page:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        pageSize:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        totalCount:
          type: integer
          minimum: 0
        totalPages:
          type: integer
          minimum: 0
      required:
        - page
        - pageSize
        - totalCount
        - totalPages
    ValidationError:
      type: object
      properties:
        error:
          type: string
          example: Validation error
        details:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                example: invalid_string
              message:
                type: string
                example: Valid email is required
              path:
                type: array
                items:
                  type: string
                example:
                  - email
    PracticeArea:
      type: string
      enum:
        - ABA
        - ACADEMY
        - DIR_FLOORTIME
        - FEEDING_THERAPY
        - NURSING
        - OCCUPATIONAL_THERAPY
        - PHYSICAL_THERAPY
        - SCHOOL_BASED_ABA
        - SPEECH_LANGUAGE_PATHOLOGY
        - FACILITY
      description: Clinical practice area of the treatment plan
    TreatmentPlanPatientSchema:
      type: object
      properties:
        publicId:
          type: string
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
      required:
        - publicId
  responses:
    '400':
      description: Bad Request - Validation Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: An unexpected error occurred

````