> ## 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 Treatment Plan By Id

> Get a single treatment plan by planId including associated goals

## Get Treatment Plan By Id

Retrieve a single treatment plan by its planId, including associated goals.

### Headers

```
Authorization: Bearer <your-api-key>
```

### Path Parameters

* `planId` (required): Treatment plan public identifier

### Success Response (200)

```json theme={null}
{
  "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"
  },
  "goals": ["goal_123", "goal_456"]
}
```

### Error Responses

#### 400 - Validation Error

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

#### 500 - Internal Server Error

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

## Examples

### cURL Example

```bash theme={null}
# Get treatment plan by planId
curl -X GET "https://app.hipp.health/api/v1/treatment-plans/tp_abc123def456" \
  -H "Authorization: Bearer your-api-key"
```

### JavaScript Example

```javascript theme={null}
const getTreatmentPlanById = async (planId) => {
  const response = await fetch(
    `https://app.hipp.health/api/v1/treatment-plans/${planId}`,
    {
      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 plan");
  }

  return response.json();
};

// Usage
try {
  const treatmentPlan = await getTreatmentPlanById("tp_abc123def456");
  console.log("Treatment Plan:", treatmentPlan);
  console.log("Goals:", treatmentPlan.goals);
} catch (error) {
  console.error("Error fetching treatment plan:", error.message);
}
```


## OpenAPI

````yaml GET /v1/treatment-plans/{planId}
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/{planId}:
    get:
      tags:
        - V1
      summary: Get treatment plan by ID
      description: Get a single treatment plan by planId including associated goals
      operationId: get-v1-treatment-plans-{planId}
      parameters:
        - in: path
          name: planId
          schema:
            type: string
          required: true
          example: '123'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreatmentPlanResponseSchema'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    TreatmentPlanResponseSchema:
      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'
        goals:
          type: array
          items:
            type: string
      required:
        - publicId
        - createdAt
        - updatedAt
        - patient
        - goals
    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
    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
  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

````