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

# Book appointments

> Book, move and cancel, and follow bookings made in Docistra.

## Check what's free

```bash theme={null}
GET /api/v1/availability?doctor_id=ext:D-7&date=2026-12-03
```

```json theme={null}
{
  "data": {
    "mode": "time",
    "branch_id": "5e0a...",
    "duration_minutes": 30,
    "slots": ["2026-12-03T14:00:00.000Z", "2026-12-03T14:30:00.000Z"]
  }
}
```

A doctor's day is either timed (`mode: "time"`, book a `start`) or a queue of walk-in numbers (`mode: "queue"`, book a `date` and get the `next_number`). `mode: "closed"` means the doctor doesn't work that day.

## Book

```bash theme={null}
curl -X POST https://docistra.com/api/v1/appointments \
  -H "Authorization: Bearer $DOCISTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: appt-A-55012" \
  -d '{
    "external_id": "A-55012",
    "doctor_id": "ext:D-7",
    "start": "2026-12-03T16:00:00+02:00",
    "patient_id": "ext:P-10293",
    "notify_patient": true
  }'
```

* Send `patient_id` for a known patient, or a `patient` object to create or match one in the same call (see [Sync patients](https://developers.docistra.com/guides/sync-patients.md)).
* `type: "follow_up"` books a follow-up visit (priced as one).
* `duration_minutes` overrides the doctor's session length.
* `notify_patient: true` sends the booking confirmation on WhatsApp (SMS when WhatsApp can't reach them). The default is `false`, for when your system confirms itself.
* Docistra checks the doctor's hours, days off, breaks and other bookings. Organizations whose schedule lives in your system can skip the hours check with `enforce_schedule: false` (see [Master record](https://developers.docistra.com/concepts/master-record.md)).

## Move

```bash theme={null}
curl -X PATCH https://docistra.com/api/v1/appointments/ext:A-55012 \
  -H "Authorization: Bearer $DOCISTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "start": "2026-12-03T18:00:00+02:00" }'
```

The appointment keeps its id. Change `doctor_id` or `branch_id` the same way. The patient is told about the new time unless you send `notify_patient: false`.

## Cancel

```bash theme={null}
curl -X POST https://docistra.com/api/v1/appointments/ext:A-55012/cancel \
  -H "Authorization: Bearer $DOCISTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Patient asked" }'
```

The patient is told unless `notify_patient: false`. Cancelling a whole day for a doctor? Use [Doctor day off](https://developers.docistra.com/guides/doctor-day-off.md).

## Check-in and visit status

`POST /appointments/{id}/status` with `arrived`, `in_progress`, `completed` or `no_show` keeps the clinic's board in step with your front desk.

## Bookings made in Docistra

The AI agent books on WhatsApp, patients book on the clinic's page, and reception books in Docistra. Listen to `appointment.created`: `source` tells you where it came from. Create it in your system and link it back with `PATCH /appointments/{id}` `{"external_id": "..."}`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.