Create slot booking

Query Parameters

NameTypeRequiredDescription
organisation_idintegerYesOrganisation to book with

Path Parameters

No path parameters

Header Parameters

No header parameters

Request Body

SlotBooking object

NameTypeRequiredDescription
appointment_type_idintegerYesThe ID of the appointment type
startdatetimeYesThe start time (UTC) of the activity, e.g. 2023-07-27 06:30:00+00
enddatetimeYesThe end time (UTC) of the activity, e.g. 2023-07-27 06:30:00+00
patient_idintNoThe ID of the patient to be booked
provider_idsarray[integer]NoCandidate providers to book; one is chosen by availability. Empty means any available provider
first_namestringNoFirst name of the patient to create when no patient_ids is given
last_namestringNoLast name of the patient to create when no patient_ids is given
emailstringNoEmail of the patient to create when no patient_ids is given
statestringNoState of the patient to create when no patient_ids is given
coveragestringNoInsurance of the patient to create when no patient_ids is given

Responses

200 — OK

Booking created (or joined an existing session).

{
  "id": 123,
  "appointment_type_id": 5,
  "start": "2023-07-27T06:30:00+00:00",
  "end": "2023-07-27T07:00:00+00:00",
  "notes": null,
  "organisation_id": 1,
  "provider": "Jane Smith"
}

403 — Forbidden

DetailWhen
You don't have permission to use this appointmnet type or it does not existappointment_type_id not found for the org

409 — Conflict

DetailWhen
This time is no longer availableSingle/any provider: no free shift contains the slot
This time is no longer available for all selected providersMultiple provider_ids: not all are free
This session is fullJoining an existing activity that's at max_capacity

422 — Unprocessable Entity

DetailWhen
No shift available at the requested timeNo shift spans the requested start/end
Unprocessable EntityMissing required organisation_id, or malformed slot_in body (bad/missing activity_type_id, start, end).
Too many providers for this appointment typeMore providers than required_hosts allows
This appointment type requires {N role(s)...}required_hosts not satisfied
This appointment type allows at most {max_capacity} patientsToo many patient_ids
The selected provider is not licensed in the patient's stateProvider lacks state license
The selected provider is not enrolled in the patient's payorPayor enrollment required, provider not enrolled
The selected provider does not have a required skill for this patientpatient_match_criteria skill not met

429 — Too Many Requests

Rate limit exceeded (PRIMARY_RATE_LIMIT).