Creating data (FHIR)
Create a patient
Register a new patient from a FHIR Patient resource.
POST
/api/fhir/PatientScope fhir.writeCreates a patient in your practice. name (family + given) is required. A South African ID number (identifier system below) is validated, and a patient with the same ID or passport number is refused with 409 so you never create duplicates.
The response is the stored Patient, including the new id and patient number, with a Location header.
POST /api/fhir/Patient
curl -X POST "https://system.clinicview.co.za/api/fhir/Patient" \
-H "Authorization: Bearer $CLINICVIEW_API_KEY" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/fhir+json" \
--data-binary @- <<'JSON'
{
"resourceType": "Patient",
"name": [
{
"use": "official",
"family": "Dlamini",
"given": [
"Sipho"
]
}
],
"gender": "male",
"birthDate": "1985-06-15",
"identifier": [
{
"system": "https://fhir.clinicview.co.za/identifier/za-id-number",
"value": "8506155800087"
}
],
"telecom": [
{
"system": "phone",
"value": "+27831112222"
},
{
"system": "email",
"value": "sipho@example.com"
}
],
"address": [
{
"line": [
"4 Protea Avenue"
],
"city": "Midrand",
"state": "Gauteng",
"postalCode": "1685"
}
]
}
JSON{
"resourceType": "Patient",
"id": "6d1f3b5a-7c9e-4b2d-8f1a-3c5e7a9b1d00",
"meta": {
"lastUpdated": "2026-11-20T09:14:05+02:00"
},
"identifier": [
{
"use": "usual",
"system": "https://fhir.clinicview.co.za/identifier/patient-number",
"value": "P000124"
},
{
"use": "official",
"system": "https://fhir.clinicview.co.za/identifier/za-id-number",
"value": "8506155800087"
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Dlamini",
"given": [
"Sipho"
]
}
],
"telecom": [
{
"system": "phone",
"value": "+27831112222",
"use": "mobile"
},
{
"system": "email",
"value": "sipho@example.com"
}
],
"gender": "male",
"birthDate": "1985-06-15",
"address": [
{
"line": [
"4 Protea Avenue"
],
"city": "Midrand",
"state": "Gauteng",
"postalCode": "1685",
"country": "ZA"
}
],
"communication": [
{
"language": {
"text": "en"
},
"preferred": true
}
]
}Request body
application/fhir+json · A FHIR R4 Patient resource.
Responses
- 201Created.
Locationpoints to the new Patient.Headers:Location - 400Body must be a FHIR JSON resource
- 401Missing or malformed API key
- 403API key lacks the fhir.write scope
- 409A patient with this identifier already exists: Patient/8f2c6a1e-4b7d-4c1a-9e3f-2d5b7a9c0e11
- 422Patient.name with family and given is required
- 429Rate limit exceeded: 300 requests per minute per keyHeaders:
Retry-AfterX-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset