Create Referral
Queues a referral for creation in the provider’s EMR system.
/referrals call you can display a Processing status to your user, and when you receive the webhook notification you can update that to Completed.
Request Parameters
Required Fields
- patient_mrn (string, required): The patient’s medical record number. The patient must already be synced to Cobalt.
- referring_from_provider_ehr_id (string, required): EMR ID of the provider the referral is coming from.
- referring_to_provider_ehr_id (string, required): EMR ID of the provider the referral is going to.
- direction (string, required): Direction of the referral —
incomingoroutgoing. - priority (string, required): Referral priority —
routine,urgent, orstat. - reason (string, required): Reason for the referral.
Optional Fields
- diagnosis_codes (array of strings, optional): ICD-10 diagnosis codes associated with the referral.
- documents (array, optional): Documents to attach to the referral in the EMR. Each entry is an object with
filenameandcontent_base64. See Attaching Documents below.
Direction and Provider Validation
The two provider IDs are validated against different directories depending on the referral’sdirection:
| Direction | referring_from_provider_ehr_id validated against | referring_to_provider_ehr_id validated against |
|---|---|---|
incoming | Referring providers directory | Providers directory |
outgoing | Providers directory | Referring providers directory |
0 for a provider ID when there is no provider on that side. Providers must already be synced — use GET /v1/providers and GET /v1/referring-providers to resolve IDs.
Attaching Documents
Documents are optional and supplied inline as base64. Each document is an object:- filename must include a file extension (e.g.
report.pdf). - content_base64 must be non-empty, valid base64.
POST /v1/referrals endpoint accepts request bodies up to 25 MB.Example Request
Request with Documents
Example Response
- referral_id: Cobalt referral ID (UUID without dashes). This is echoed back in the webhook payload so you can correlate the two.
- job_id: Job execution identifier for tracking the async operation.
Error Responses
Missing Required Field
Invalid Priority
Invalid Direction
Invalid Document
Patient Not Found
Unknown Provider
User Not Found
Webhook Notifications
When the referral has finished processing, we send a webhook to your registered endpoint.Success
documents_attached and documents_failed are only included when the request contained documents.
Failure
Authorizations
Body
The patient's medical record number. The patient must already be synced to Cobalt.
EMR ID of the provider the referral is coming from. For incoming referrals this is validated against the referring providers directory; for outgoing referrals it is validated against the providers directory. Pass 0 if there is no provider on this side.
EMR ID of the provider the referral is going to. For incoming referrals this is validated against the providers directory; for outgoing referrals it is validated against the referring providers directory. Pass 0 if there is no provider on this side.
Direction of the referral. incoming means the referral is coming into your organization; outgoing means it is being sent out.
incoming, outgoing Referral priority.
routine, urgent, stat Reason for the referral.
Optional ICD-10 diagnosis codes associated with the referral.
Optional documents to attach to the referral in the EMR. Each entry is supplied inline as base64. Document attachment happens after the referral is created and attachment failures are non-fatal.
Response
Referral queued successfully