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

# Quickstart

> From zero to a booked appointment in six requests

You need an API key ([Authentication](/authentication)) and the practice's host, `https://{clinic}.{region}.practicehub.io` — the region host is the one in the practice's login URL — `neptune` (London), `mercury` (Frankfurt), `vulcan` (Ohio), `jupiter` (Singapore) or `apollo` (Sydney). Replace `your-clinic.your-region` and `$KEY` below.

<Steps>
  <Step title="Discover the model">
    ```bash theme={null}
    curl https://your-clinic.your-region.practicehub.io/v3/api/schema/appointments \
      -H "Authorization: Bearer $KEY"
    ```

    The response lists the resource's attributes, which are filterable and sortable, the write operations it supports and the input each accepts.
  </Step>

  <Step title="Find the reference data">
    ```bash theme={null}
    curl "https://your-clinic.your-region.practicehub.io/v3/api/locations" -H "Authorization: Bearer $KEY"
    curl "https://your-clinic.your-region.practicehub.io/v3/api/appointment_types" -H "Authorization: Bearer $KEY"
    curl "https://your-clinic.your-region.practicehub.io/v3/api/practitioners?active=eq:1" -H "Authorization: Bearer $KEY"
    ```
  </Step>

  <Step title="Create the patient">
    ```bash theme={null}
    curl -X POST https://your-clinic.your-region.practicehub.io/v3/api/patients \
      -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
      -d '{
        "first_name": "Ada", "last_name": "Lovelace", "email": "ada@example.com",
        "numbers": [{ "number": "07700900123", "country_code": "44", "iso2": "GB", "type": "mobile" }],
        "metadata": { "crm_id": "hs-778" }
      }'
    ```

    The response is the created record under `data`, including its `id` and your `metadata`.
  </Step>

  <Step title="Find a free slot">
    ```bash theme={null}
    curl "https://your-clinic.your-region.practicehub.io/v3/api/availability?location_id=81&appointment_type_id=1&from=2026-09-01" \
      -H "Authorization: Bearer $KEY"
    ```

    Free, bookable slots for the coming week in the clinic's timezone — each with the `practitioner_id`, `start` and `end` to book. See [Booking](/guides/booking) for the patient vs staff view and the parameters.
  </Step>

  <Step title="Book the appointment">
    ```bash theme={null}
    curl -X POST https://your-clinic.your-region.practicehub.io/v3/api/appointments \
      -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
      -d '{
        "patient_id": 340, "location_id": 81, "appointment_type_id": 1, "practitioner_id": 109,
        "start": "2026-09-01 09:00:00", "end": "2026-09-01 09:30:00", "note": "Booked from the website"
      }'
    ```

    Times are in the clinic's timezone. The booking is validated exactly as in the PracticeHub calendar (active patient, location, practitioner, resource), refused with `409 slot_unavailable` if the time was taken in the meantime, and confirmation messaging is triggered as normal.
  </Step>

  <Step title="Find it again later">
    ```bash theme={null}
    curl -g "https://your-clinic.your-region.practicehub.io/v3/api/patients?metadata[crm_id]=eq:hs-778" \
      -H "Authorization: Bearer $KEY"
    ```
  </Step>
</Steps>

<Tip>
  Prefer to let an AI do this? The [MCP server](/mcp/overview) exposes the same model to Claude, ChatGPT and custom agents.
</Tip>
