For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Home
    • About the Referral Exchange (RefX)
  • Getting Started
    • API Overview
    • Accessing our APIs
    • Authentication
    • Content Types
    • Request and Response Limits
    • Create and Edit Referrals
    • Print Referrals
    • List Referrals
    • Cancel & Withdraw Referrals
    • Timeline Events
    • Implementation Reference
  • Concepts
    • Referral Lifecycle & Statuses
    • Referral Notes
    • Browser Tab Handling
    • Referral Link
    • NEHR Integration
  • API Reference
      • POSTCreate a new referral link
    • Changelog
LogoLogo
API ReferenceCreating Referrals

Create a new referral link

POST
/api/v1/links/upsert
POST
/api/v1/links/upsert
$curl -X POST https://dummy-url-see-smartcms-spec/api/v1/links/upsert \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "referrerInstitutionId": "S1234A",
> "referrerInstitutionIdType": "hci",
> "referrerInstitutionName": "Singapore General Hospital",
> "referrerId": "MCR12345A",
> "requesterIdentifier": "dr.jane.doe@example.com",
> "referrerIdType": "mcr",
> "referrerName": "Dr. Jane Doe"
>}'
1{
2 "referralId": "ref-9876543210",
3 "url": "https://refer.health.gov.sg/referral/ref-9876543210",
4 "type": "upsert"
5}
Was this page helpful?
Previous

Changelog

Next
Built with

Authentication

Authorizationstring

API key to authenticate for external integrations. Use the format: “ApiKey insert-token-here”

Request

This endpoint expects an object.
referrerInstitutionIdstringRequired
HCI code of the institution authoring this referral.
referrerInstitutionIdTypeenumRequired
The type of institution ID
Allowed values:
referrerInstitutionNamestringRequired
Name of the institution authoring this referral.
referrerIdstringRequired
Id of the doctor authoring this referral.
requesterIdentifierstringRequired
Identifier for the individual requesting the link. The individual may or may not be the referrer. Preferred to be an email.
referrerIdTypeenumRequired
Type of ID specified in referrerId.
Allowed values:
referrerNamestringRequired
Name of the doctor authoring this referral.
referrerEmailstringOptional
Email of the doctor authoring this referral.
referrerContactNumberstringOptionalformat: "^[3689][0-9]{7}$"
Contact number of the doctor authoring this referral.
patientUinstringOptional
Patient UIN, e.g. NRIC or FIN
patientNamestringOptional
Patient name
patientPhoneNumberstringOptionalformat: "^[3689][0-9]{7}$"

Patient phone number - only Singaporean accepted for now

patientDobstringOptionalformat: "ISO 8601"
Patient date of birth
patientGenderenumOptional
Patient gender
Allowed values:
addressobjectOptional
residentialStatusenumOptional
Patient residential status
Allowed values:
nationalityenumOptional
Patient nationality
isPatientHsgEnrolledbooleanOptional

Patient Healthier SG (HSG) enrolment status

clinicLicenseNumberstringOptional
Clinic license number
clinicTypeenumOptional
Clinic type
Allowed values:
clinicalInfostringOptional
Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc.

Response

referralIdstring
The ID of the referral
urlstring
The URL of the link
typeenum
type of referral link
Allowed values:

Errors

400
Bad Request Error
401
Unauthorized Error