Creates a new patient record and returns the persisted patient with a system-assigned patient_id. Duplicate patients (exact match on firstname + surname + date_of_birth) are blocked unless force_create: 1 is set. Send an Idempotency-Key header so a retry after a timeout cannot create a second patient.
Use cases
Create a patient via an external booking system.
Bulk-import patient demographics from a Customer Resource Management (CRM) system.
Create a new patient booking via a voice AI agent.
Request headers
Idempotency-Key
| string | Optional, strongly recommended. A unique value you create for each new patient: 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
firstname
| string | Required. 1-30 characters, counted after accented letters are converted to plain letters. |
surname
| string | Required. 1-30 characters, counted after accented letters are converted to plain letters. |
date_of_birth
| string | Required. YYYY-MM-DD, 1900-01-01 to today. |
practitioner_id
| number | Preferred practitioner. Active practitioner_id from /api/v1/practitioners. Omit it, or send 0, for no preferred practitioner. |
gender_code
| string | Optional. M or F (either case). Any other value is rejected with 422. |
title
| string | Up to 6 characters (for example MR, MRS, DR). |
middle_name
| string | Up to 15 characters. |
email
| string | Up to 60 characters. Must be a complete address (for example user@example.com). Anything else returns 400 with the message Invalid email format followed by the reason (no support_code). An empty string is accepted and stored as an empty string. |
phone_home
| string | Up to 20 characters. |
phone_mobile
| string | Up to 20 characters. Must contain 7 to 15 digits; spaces, hyphens, brackets and + are allowed. Anything else returns 400 with the message Invalid mobile number format or Invalid mobile number length (no support_code). An empty string is accepted and stored as an empty string. |
phone_work
| string | Up to 20 characters. |
occupation
| string | Up to 30 characters. |
company
| string | Up to 100 characters. |
address_line1
| string | Up to 300 characters. |
address_line2
| string | Up to 40 characters. |
suburb
| string | Up to 80 characters. |
state
| string | One of NSW, VIC, QLD, WA, SA, TAS, ACT or NT (either case). Any other value returns 400 PW-6027. |
postcode
| string | 4 digits, 0200-9999. |
address_line1_work
| string | Up to 300 characters. |
address_line2_work
| string | Up to 40 characters. |
suburb_work
| string | Up to 80 characters. |
state_work
| string | One of NSW, VIC, QLD, WA, SA, TAS, ACT or NT (either case). Any other value returns 400 PW-6027. |
postcode_work
| string | 4 digits, 0200-9999. |
force_create
| integer | 0 blocks duplicates (default), 1 allows duplicate creation. |
Returns
A 200 response returns the persisted patient object in data[0], including the system-assigned patient_id. The fields match those described on Get patient by ID. The record shows the values as the practice software stores them. For example, a title of MS is returned as Ms, state and suburb are returned in capitals, gender_code F is returned as gender female, and preferred_name is set to firstname.
If the patient is created but some contact or address details cannot be saved, the response is 200 with support_code PW-6006, the new id in partial_patient_id and a warnings[] entry. Update the missing details with Update patient. On practice databases older than data model V19 the request fails instead and the patient is not saved.
Error responses
200 | PW-6006
| The patient was created but some contact or address details were not saved. See partial_patient_id and warnings[]. |
400 | PW-6010
| date_of_birth outside 1900-01-01 to today.
|
400 | PW-6020
| postcode failed Australian validation.
|
400 | PW-6025
| A field contains characters with no supported ASCII equivalent. |
400 | PW-6026
| A field exceeds its maximum length after character conversion. |
400 | PW-6023
| A field contains HTML or script-like content (for example < followed by a letter). |
400 | PW-6027
| state or state_work is not one of NSW, VIC, QLD, WA, SA, TAS, ACT or NT.
|
400 | (none) | email or phone_mobile has an invalid format.
|
400 | RP-4000
| Idempotency-Key is not 8 to 128 characters of letters, digits, underscore, full stop or hyphen.
|
403 | PW-6008
| Access denied. |
404 | PW-6012
| practitioner_id not found or not active.
|
409 | PW-6001
| Duplicate patient (name and date-of-birth match). The response carries duplicate_patient_id and duplicate_card_no. Pass force_create: 1 to allow. |
409 | RP-4091
| The first request with this Idempotency-Key is still running, or its outcome is unknown and the key is held. The response carries retry_after_seconds and, for an unknown outcome, idempotency_outcome and idempotency_retry_blocked_until. |
422 | (none) | Required field missing, wrong type (including a gender_code other than M or F), invalid date format, or value too long (schema validation). |
422 | RP-4221
| Idempotency-Key was already used with a different request.
|
500 | PW-6016
| The patient was not saved. Retry. |
500 | PW-6017
| The outcome could not be confirmed. Search for the patient (GET Patients Lite) before creating it again. If you sent a key, the response carries idempotency_outcome, idempotency_retry_blocked_until and retry_after_seconds. |
503 | RP-5032
| Duplicate protection is temporarily unavailable. Nothing was created. Retry with the same key. |
504 | SVC-504
| The request timed out. The patient may or may not have been created. Search for the patient before creating it again, or retry with the same Idempotency-Key. |
For the canonical list of error codes, see Validation, Limits & Character Handling.
Example error responses
Required field missing (422):
{ "data": [], "status": false, "message": "'surname': field required; 'date_of_birth': field required" }
Invalid date format (422):
{ "data": [], "status": false, "message": "'date_of_birth': invalid date format" }
Value too long (422):
{ "data": [], "status": false, "message": "'firstname': ensure this value has at most 30 characters" }
Wrong type (422):
{ "data": [], "status": false, "message": "'force_create': value is not a valid integer" }
date_of_birth out of range (400):
{ "data": [], "status": false, "message": "date_of_birth must be between 1900-01-01 and today (got 1800-01-01).", "support_code": "PW-6010" }
Invalid postcode (400):
{ "data": [], "status": false, "message": "postcode must be a valid Australian postcode (4 digits, range 0200-9999; got 'ABCD').", "support_code": "PW-6020" }
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: firstname). Re-submit using Latin characters only. [PW-6025]", "support_code": "PW-6025" }
Field too long after conversion (400):
{ "data": [], "status": false, "message": "One or more fields exceed the maximum length the practice management system accepts after special characters were converted to plain text (fields: firstname (56>30)). Shorten the affected field(s) and resubmit. [PW-6026]", "support_code": "PW-6026" }
Practitioner not found (404):
{ "data": [], "status": false, "message": "Practitioner not found.", "support_code": "PW-6012" }
Duplicate patient (409):
{ "data": [], "status": false, "message": "A patient with this name and date of birth already exists (patient ID 72, card 72).", "support_code": "PW-6001", "duplicate_patient_id": 72, "duplicate_card_no": "72" }
Invalid email format (400):
{ "data": [], "status": false, "message": "Invalid email format: must be a complete email address (e.g. user@example.com)." }
gender_code other than M or F (422):
{ "data": [], "status": false, "message": "'gender_code': string does not match regex \"^[MmFf]$\"" }
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" }
First request with the key still running (409):
{ "data": [], "status": false, "message": "Idempotency-Key reservation in progress; retry in a few seconds.", "support_code": "RP-4091" }
Key reused with a different request (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" }
Outcome unknown, key held (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": 840 }
Important notes
Apostrophes: text that contains an apostrophe is stored as sent, so
O'Brien is stored with one apostrophe. A patient saved through the API before November 2026 was stored with two apostrophes (
O''Brien), and POST Patient may not recognise that patient as an existing one. Correct such records in the practice software. See the November 2026 entry in the
Change Log.
Required fields are firstname, surname, and date_of_birth.
practitioner_id is optional.
Duplicate detection is by exact match on firstname + surname + date_of_birth. Override with force_create: 1.
Character handling: accented characters are converted to their plain-letter equivalent (for example, Zoë becomes Zoe, François becomes Francois). Characters with no supported equivalent (CJK, emoji, Cyrillic) are rejected with PW-6025. See Validation, Limits & Character Handling.
postcode must be a 4-digit Australian postcode in the range 0200-9999 (both residential and work).
Unknown fields in the request body are silently ignored.
practitioner_id of 0 or omitted leaves the patient without a preferred practitioner.
Platform errors such as
MOD-4268 (the practice database needs an upgrade),
RP-5037 (daily request allowance used up for a Halo Connect practice) and
SVC-502,
SVC-503 and
SVC-504 can be returned by any endpoint. See
Validation, Limits & Character Handling.
Idempotency
Send an Idempotency-Key header so that a retry cannot create a second patient. The header is optional but strongly recommended.
Key format: 8 to 128 characters using letters, digits, underscore, full stop and hyphen. A UUID is a good choice. Create a new random key for each new patient and reuse it only to retry the same request. Keys are shared by every application connected to the same practice, so never use predictable values.
Replay after success: For 24 hours, the same key with the same request returns the original response again (same status, same record id, same values). The body is the same as the first response, including the date-time format. The order of fields in the JSON body does not matter.
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 200 with no error code, a message saying the record was created but its details could not be retrieved, and data holding only the new patient_id. The record exists, so do not create it again: look it up with GET Patient By ID. The same response is returned if you retry with the same key within 24 hours.
Different request: The same key with a different request returns 422 with support_codeRP-4221. A key belongs to the first request sent with it.
First request still running: Returns 409 with support_codeRP-4091. Wait a few seconds and retry with the same key.
Request rejected: If the request is rejected with a definite error (for example a validation failure, a duplicate patient PW-6001), the key is released. Correct the request and retry with the same key. Validation runs before the key is checked, so a request rejected there does not use the key.
Unknown outcome: If a request times out or the connection is lost after the request reached the practice database, the outcome is unknown. The key is then held for 15 minutes for cloud-hosted practices, or about 75 minutes for practices connected through Halo Connect. The response (whatever its status) carries idempotency_outcome set to unknown, idempotency_retry_blocked_until (UTC), retry_after_seconds and a Retry-After header. A retry with the same key during the hold returns 409RP-4091 with the same fields. Do not create the patient with a new key during the hold. After the hold ends, search with GET Patients Lite (by name and date of birth) to check whether the patient exists before creating it again.
Key store unavailable: Returns 503 with support_codeRP-5032, retry_after_seconds 5 and Retry-After: 5. Nothing was created. Retry with the same key.
No key: There is no duplicate protection. A retry after a timeout can create a second patient.
Quick example
curl -X POST "https://api-uat.dental4web.com.au/api/v1/patients" \
-H "x-api-key: $API_KEY" \
-H "org-id: $ORG_ID" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Idempotency-Key: 3f6c2a1e-7b4d-4c1a-9e2f-8d5b6a7c9e10" \
-d '{"firstname":"John","surname":"Mitchell","date_of_birth":"1985-03-22","postcode":"2000","state":"NSW"}'