POST
/transactional-api/create-outbound-referralCreate Outbound Referral
Creates an outbound referral against a patient record. Supply a SNOMED CT coded reason via code (required). If a ubrn is provided the referral is created as an NHS e-RS referral; otherwise a manual referral is created. Optional file attachments are base64-encoded. The referrer defaults to the act practitioner and organisation in the access token. Send referredByPractitioner / referredByOrganisation when the clinician who decided to refer is not the token user. With neither, the referrer shows as Unknown. Send referredToService for the service or clinic it was booked to.
Authorization: Bearer token (JWT). See Authentication.
Request
curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/create-outbound-referral' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": {
"conceptId": "185389009",
"description": "Telephone encounter"
},
"referralDate": "2026-01-15",
"priority": "routine",
"ubrn": "123456789012",
"referredToOrganisation": {
"name": "Queen Elizabeth Hospital"
},
"referredToPractitioner": {
"name": "Dr Sarah Chen"
},
"referredToService": {
"name": "Cardiology Outpatients"
},
"referredByPractitioner": {
"name": "Dr James Patel",
"gmcNumber": "1234567"
},
"referredByOrganisation": {
"name": "Riverside Medical Centre",
"odsCode": "A12345"
},
"additionalInformation": "Patient has been informed of the referral and agreed to proceed.",
"consultationTopicHeadingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"hiddenFromPatientFacingServices": false,
"confidentialFromThirdParties": false,
"attachments": [
{
"fileName": "referral-letter.pdf",
"contentType": "application/pdf",
"data": "JVBERi0xLjQK..."
}
]
}'
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
patientId | string<uuid> | Yes | Medicus patient identifier. |
code | object | Yes | SNOMED CT coded referral reason. Required; resolved against the NHS term browser. |
referralDate | string<date> | No | Referral date (YYYY-MM-DD). Defaults to today. |
priority | string | No | Outbound referral priority. |
ubrn | string | No | Unique Booking Reference Number. When present, the referral is created as an NHS e-RS referral. |
referredToOrganisation | object | No | Object with: name. |
referredToPractitioner | object | No | Object with: name. |
referredToService | object | No | Service or clinic the referral was booked to. For an e-RS referral this is the shortlisted service name. |
referredByPractitioner | object | No | Clinician who decided to refer. Defaults to the token user. The token user is still recorded in the audit trail as the person who submitted it. |
referredByOrganisation | object | No | Organisation the referral was made from. Defaults to the token organisation, or this practice. |
additionalInformation | string | No | |
consultationTopicHeadingId | string<uuid> (nullable) | No | |
hiddenFromPatientFacingServices | boolean | No | If true, hidden from Patient Facing Services (IM1) such as the NHS App. |
confidentialFromThirdParties | boolean | No | |
attachments | array<object> | No | File attachments to file against the referral. |
Responses
200 Referral created.
Response fields
| Field | Type | Description |
|---|---|---|
id | string<uuid> | Identifier of the created outbound referral. |
{
"id": "00000000-0000-0000-0000-000000000000"
}
400 Validation error.
12 possible code values
| Code | Description | When |
|---|---|---|
missing-patient-id | The patientId is required | patientId missing |
invalid-patient-id | The patientId is not valid | patientId not a valid UUID |
patient-not-found | Patient not found for this patientId | patientId doesn't exist |
invalid-code | Could not resolve conceptId into a SNOMED CT code. Check the NHS term browser. | code conceptId doesn't resolve to a SNOMED CT code |
no-code | You must specify a code for the referral. | code missing |
invalid-referral-date | The referralDate is not a valid date in Y-m-d format. | referralDate not a valid date in Y-m-d format, or in the future |
invalid-priority | The priority is not a valid outbound referral priority. | priority not a valid outbound referral priority |
missing-referred-by-practitioner-name | The referredByPractitioner name is required | referredByPractitioner supplied without a name |
missing-referred-by-organisation-name | The referredByOrganisation name is required | referredByOrganisation supplied without a name |
invalid-consultation-topic-heading-id | The consultationTopicHeadingId is not a UUID | consultationTopicHeadingId not a UUID |
consultation-topic-heading-not-found | Consultation topic heading not found for this consultationTopicHeadingId | consultationTopicHeadingId doesn't exist |
empty-file | A file is required: data is missing or empty. | data is missing or empty |
Response fields
| Field | Type | Description |
|---|---|---|
errors[].code | string | |
errors[].description | string |
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}