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

# Create Appointment

> Schedule a new appointment

## Body Parameters

<ParamField body="patientId" type="string" required>The patient ID</ParamField>
<ParamField body="doctorId" type="string" required>The doctor/practitioner ID</ParamField>
<ParamField body="locationId" type="string" required>The clinic location ID</ParamField>
<ParamField body="procedureId" type="string" required>The clinical procedure ID</ParamField>
<ParamField body="startTime" type="string" required>Start time in ISO 8601 format with timezone</ParamField>
<ParamField body="endTime" type="string" required>End time in ISO 8601 format with timezone</ParamField>
<ParamField body="notes" type="string">Optional notes for the appointment</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.nevatal.com/api/v1/appointments" \
    -H "Authorization: Bearer nvtl_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "patientId": "pat_abc123",
      "doctorId": "usr_doctor456",
      "locationId": "loc_main",
      "procedureId": "proc_general_consult",
      "startTime": "2025-04-01T09:00:00-05:00",
      "endTime": "2025-04-01T09:30:00-05:00",
      "notes": "Initial consultation"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "apt_xyz789",
    "patientId": "pat_abc123",
    "doctorId": "usr_doctor456",
    "locationId": "loc_main",
    "procedureId": "proc_general_consult",
    "startTime": "2025-04-01T09:00:00-05:00",
    "endTime": "2025-04-01T09:30:00-05:00",
    "status": "confirmed",
    "notes": "Initial consultation",
    "createdAt": "2025-03-20T15:00:00Z"
  }
  ```

  ```json 409 theme={null}
  {
    "statusCode": 409,
    "error": "Conflict",
    "message": "Time slot overlaps with an existing appointment"
  }
  ```
</ResponseExample>
