POST Appointment
Books a new appointment for a patient in a specific appointment book and time slot.
Use cases
- An online booking system pushes a new appointment into the practice.
- Book appointments from a Customer Resource Management (CRM) system.
- Create a booking via a voice AI agent.
Request headers
| string | Optional, strongly recommended. A unique value you create for each new appointment: 8 to 128 characters using letters, digits, underscore, full stop or hyphen (a UUID works well). Reuse it only to retry the same request. See Idempotency below. |
Request body
| integer | Required. 1 or greater. Use GET /api/v1/appointment-slots to discover bookable IDs. |
| string | Required. YYYY-MM-DD. |
| integer | Required. 1 or more. The unique identifier for a patient in the database. |
| string | Required. HH:MM (24-hour). |
| string | Required. HH:MM, strictly after |
| integer |
|
| integer | From /api/v1/appointment-classes. Default 1. |
| string | Up to 450 characters. |
| integer | Optional, 1 or greater. The staff member to record as Appointed By. On a practice on data model V20 or later it is recorded and returned as |
Returns
A 200 returns the created appointment in data (an array holding the one appointment), with the same fields as Get appointment by ID. The notes value is returned in the response.
Idempotency
Send an Idempotency-Key header with every create. If a request times out or the connection drops, you can then send the same request again with the same key without booking the appointment twice. PATCH Appointment, POST Appointment Cancel and POST Appointment Reschedule do not accept a key.
- Key format: 8 to 128 characters from
AtoZ,atoz,0to9, underscore, full stop and hyphen. Leading and trailing spaces are removed. A badly formed key returns400withRP-4000. - Scope: a key applies to the practice (
org-id) and this endpoint. It is not tied to an integrator or API key, so two applications connected to the same practice share the key space. Always use random values. - Same key, same request, after a successful booking: for 24 hours you receive the original response again (same status, same
appointment_idand same record). The replay carries no marker to tell it apart from the first response, and the order of fields in your JSON body does not matter. The body is the same as the first response, including the date-time format. - Saved, but the details could not be read back: In rare cases the request is saved but the API cannot read the new record back to build the full response. You then receive
200with no error code, a message saying the record was created but its details could not be retrieved, anddataholding only the newappointment_id. The record exists, so do not create it again: look it up with GET Appointment By Id. The same response is returned if you retry with the same key within 24 hours. - Same key, different request: returns
422withRP-4221. A key belongs to the first request sent with it. - Same key while the first request is still running: returns
409withRP-4091. Retry after a few seconds with the same key. - Requests rejected with a definite error: any
4xx(validation,AW-6021slot taken,AW-6012patient not found and so on) releases the key. Correct the request and retry with the same key. Requests rejected by schema validation (422) or request validation (400, for exampleAW-6040) are checked before the key is used. - Unknown outcome: if a timeout or lost connection happens after the request reached the practice database, the key is held for 15 minutes for cloud-hosted practices and 75 minutes for practices connected through Halo Connect. A retry with the same key during the hold returns
409withRP-4091. The first response with an unknown outcome, whatever its status (409,500,502,503or504), and every held retry carryidempotency_outcome: "unknown",idempotency_retry_blocked_until(UTC, ISO 8601),retry_after_secondsand aRetry-Afterheader. Do not create the appointment with a new key during the hold. After it ends, check whether the appointment exists (GET Appointments withpatient_id) before creating it again. - Practices connected through Halo Connect: when a keyed booking has no clear answer, the API checks the appointment book about 70 seconds later. A retry with the same key then returns the saved appointment, with a
warnings[]entry saying the database confirmed the change after a delay, or books normally if nothing was saved. If the check cannot tell, the key stays held. - Key store unavailable: returns
503withRP-5032,retry_after_seconds: 5andRetry-After: 5. Nothing was created. Retry with the same key. - No key: there is no duplicate protection, and a retry after a timeout can create a second appointment.
Error responses
400 |
| Duration not greater than zero ( |
404 |
|
|
404 |
|
|
404 |
|
|
404 |
|
|
422 |
| Appointed By user N was not found: |
409 |
| The appointment book is locked for that day by another session, for example someone editing the day at the practice. The lock is temporary: retry after a short wait (for example 30 to 60 seconds) or offer another book or day. The key is released, so you can retry with the same |
409 |
| Selected time slot is no longer available. |
422 |
| Outside practice operating hours. |
422 |
|
|
400 |
|
|
422 | (none) | Required field missing, or |
403 |
| Access denied by the practice management system. |
422 |
| Appointment date out of range. |
500 |
| The booking could not be confirmed, so it may or may not have been saved. Check the appointment book before booking again. When you sent an |
500 |
| A database error occurred while saving. Check the appointment book before booking again. |
400 |
| Invalid |
409 |
| Another request with this key is still running, or an earlier request with this key has an unknown outcome and the key is held. See Idempotency. |
422 |
| The |
503 |
| Duplicate protection is temporarily unavailable. Nothing was created. Retry with the same key. |
504 |
| The API timed out waiting for the practice database. The appointment may have been saved. See Idempotency. |
notes containing characters with no ASCII equivalent, or exceeding the column width after conversion, return 400 with AW-6025 / AW-6026 (same shape as the patient PW-6025 / PW-6026 examples).
For the canonical list of error codes, see Validation, Limits & Character Handling.
Example error responses
Required fields missing (422):
{ "data": [], "status": false, "message": "'appointment_date': field required; 'patient_id': field required; 'start_time': field required; 'finish_time': field required" }
appt_book_id below 1 (422):
{ "data": [], "status": false, "message": "'appt_book_id': ensure this value is greater than or equal to 1" }
Duration not positive (400):
{ "data": [], "status": false, "message": "appointment duration must be greater than zero (start_time='10:00:00', finish_time='09:30:00').", "support_code": "AW-6042" }
Date in the past (422):
{ "data": [], "status": false, "message": "appointment_date must not be in the past (got 2026-05-24).", "support_code": "AW-6040" }
Date too far in the future (422):
{ "data": [], "status": false, "message": "appointment_date must not be more than 3650 days in the future (got 2037-05-08).", "support_code": "AW-6040" }
Outside operating hours (422):
{ "data": [], "status": false, "message": "Selected time falls outside the practice's operating hours (book 2 opens at 09:00; start_time=05:00).", "support_code": "AW-6005" }
Appointment book not found (404):
{ "data": [], "status": false, "message": "Appointment book not found.", "support_code": "AW-6010" }
Patient not found (404):
{ "data": [], "status": false, "message": "Patient not found.", "support_code": "AW-6012" }
Appointment class not found (404):
{ "data": [], "status": false, "message": "Appointment class not found.", "support_code": "AW-6051" }
Practitioner not found (404):
{ "data": [], "status": false, "message": "Practitioner not found.", "support_code": "AW-6011" }
Slot no longer available (409):
{ "data": [], "status": false, "message": "The selected time slot is no longer available. Please choose a different time.", "support_code": "AW-6021" }
Invalid Idempotency-Key (400):
{ "data": [], "status": false, "message": "Idempotency-Key must be 8-128 chars, URL-safe ([A-Za-z0-9_.-]).", "support_code": "RP-4000" }
Same key used with a different request body (422):
{ "data": [], "status": false, "message": "This Idempotency-Key was already used with a different request. Use a new key for a new request.", "support_code": "RP-4221" }
Same key retried while the outcome is unknown (409):
{ "data": [], "status": false, "message": "An earlier request with this Idempotency-Key has an unknown outcome: it may have reached the practice database, so the record may already exist or may still be created. Do not create it again before 2026-10-27T05:45:00Z UTC (a retry with a new key could create a duplicate). After that time, check whether the record exists before creating it again.", "support_code": "RP-4091", "idempotency_outcome": "unknown", "idempotency_retry_blocked_until": "2026-10-27T05:45:00Z", "retry_after_seconds": 600 }
Duplicate protection unavailable (503):
{ "data": [], "status": false, "message": "Write protection is temporarily unavailable; retry in a few seconds.", "support_code": "RP-5032", "retry_after": 5, "retry_after_seconds": 5 }
Notes contain unsupported characters (400):
{ "data": [], "status": false, "message": "One or more fields contain characters the practice management system cannot store and that have no accepted ASCII equivalent (fields: notes). Re-submit using Latin characters only. [AW-6025]", "support_code": "AW-6025" }
AW-6020 (the day is locked) and AW-6026 (notes exceed the column width after conversion) return the standard envelope with their support_code. For AW-6020 the message is “This appointment is locked and cannot be modified at this time.” The lock belongs to the appointment book and date, not to your integration: the API holds it only for the moment of each write, so a lock that lasts longer means another session is working on that day.
Important notes
- Duplicate protection: send an
Idempotency-Keywith every create. See Idempotency above. - Platform errors: errors such as
MOD-4268(the practice database needs an upgrade) andRP-5037(the Halo Connect daily request quota for the practice is used up; retry after the time given) can be returned by any endpoint. See Validation, Limits & Character Handling. - Required fields are
appt_book_id,appointment_date,patient_id,start_time, andfinish_time. - The time slot must be available in the target appointment book; conflicts return
409withAW-6021. appointment_datemust be no more than 3650 days (about 10 years) in the future and not in the past.- Duration must be greater than zero (
finish_timestrictly afterstart_time). - Operating hours are enforced (
AW-6005); outside-hours bookings are rejected. - An active practitioner is required if
practitioner_idis supplied. notesare capped at 450 characters; accented characters are converted to their plain-letter equivalent; content that looks like HTML or script is rejected outright with a400; nothing is saved, nothing is sanitised. See Notes content validation below. The acceptednotesvalue is returned in the response. Anotesvalue longer than 450 characters is rejected with422and the message'notes': ensure this value has at most 450 characters.
Notes content validation
Content in notes that looks like HTML or script is rejected outright with a 400; nothing is saved, and no warnings[] entry is produced. Two response shapes are possible depending on what’s submitted:
- Bare HTML-style markup (for example angle brackets around ordinary text) returns
AW-6023:
{ "data": [], "status": false, "message": "notes contains a disallowed HTML markup pattern and was rejected. Strip HTML tags / script / iframe / event-handler markup from this field and retry.", "support_code": "AW-6023" }
- Script-shaped or executable content (
<script>tags, event-handler attributes,javascript:URIs, and similar) is caught earlier and returns a400with nosupport_code:
{ "data": [], "status": false, "message": "Request rejected by security policy. Check your input does not contain HTML or script content." }
Confirmed live 2026-08-29: multiple independent validation layers apply this check, so a request can be caught before it reaches application logic at all. Treat both response shapes as equally final: there is no sanitise-and-save fallback for HTML/script content, unlike the ASCII-folding behaviour described above.
Quick example
curl -X POST "https://api-uat.dental4web.com.au/api/v1/appointments" \
-H "x-api-key: $API_KEY" \
-H "org-id: $ORG_ID" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 3f6c2a1e-7b4d-4c1a-9e2f-8d5b6a7c9e10" \
-d '{"appt_book_id": 5, "appointment_date": "2026-06-01", "patient_id": 12345, "start_time": "14:00", "finish_time": "14:30"}' Header Parameters
(Required)
Optional, strongly recommended. A unique value you create for each new appointment: 8 to 128 characters using letters, digits, underscore, full stop or hyphen (a UUID works well). Reuse it only to retry the same request.
Body Parameters
1 or greater. Use GET /api/v1/appointment-slots to discover bookable IDs
YYYY-MM-DD
Required. 1 or more. The unique identifier for a patient in the database.
HH:MM (24-hour)
HH:MM, strictly after start_time
Practitioner_id from /api/v1/practitioners (1 or greater).
From /api/v1/appointment-classes. Default 1
Up to 450 characters
Optional, 1 or greater. Staff member to record as Appointed By (data model V20 or later; not recorded on older practices, with a warning).
Response
Response Attributes
Show child attributes
{ "detail": [ { "loc": ["query", "from_date"], "msg": "Invalid date format. Expected YYYY-MM-DD.", "type": "value_error" } ] }
Response Attributes
Response Attributes
Response Attributes
Response Attributes
Response Attributes
POST
/
1