Docs/API Reference

Referrals

Create, list and retrieve patient referrals. The referral object, its statuses, and every field and validation rule.

A referral is a patient you've sent to Rehabify. Once you create one, Rehabify's care team and Joy, our WhatsApp care assistant, contact the patient, match them with a physiotherapist and book their care. You follow progress through the referral's status, through webhooks, and through sessions and progress reports.

MethodPath
POST/partners/referralsCreate a referral
GET/partners/referralsList referrals
GET/partners/referrals/{id}Retrieve a referral

The referral object

{
  "object": "referral",
  "id": "jd7f3k2m9x1q8w4e5r6t7y8u9i0o1p2a",
  "tracking_code": "RHB-4829173655",
  "partner_reference": "HMO-REF-2026-0091",
  "environment": "live",
  "status": "received",
  "patient": {
    "first_name": "Adeola",
    "last_name": "Balogun",
    "phone": "+2348012345678",
    "email": "adeola@example.com",
    "city": "Lagos",
    "state": "Lagos",
    "area": "Ikeja",
    "preferred_language": "en"
  },
  "clinical": {
    "condition": "Lower back pain",
    "priority": "standard",
    "recommended_sessions": 6,
    "referring_clinician": "Dr. Okafor"
  },
  "care": { "preferred_mode": "patient_choice", "preferred_contact_channel": "whatsapp" },
  "billing_mode": "hmo_direct_billing",
  "provider": null,
  "sessions": { "completed": 0, "total": 6, "last_session_at": null, "next_session_at": null },
  "links": {
    "tracking_url": "https://physioaroundme.com/track/RHB-4829173655",
    "whatsapp_intake_url": "https://wa.me/2348061525811?text=START%20RHB-4829173655"
  },
  "metadata": { "member_plan": "gold" },
  "created_at": "2026-10-13T09:30:00.000Z",
  "updated_at": "2026-10-13T09:30:00.000Z"
}
FieldTypeDescription
objectstringAlways referral.
idstringRehabify's unique ID for the referral.
tracking_codestringRHB- followed by 10 digits. Older referrals may have RHB- followed by 5 digits. Case-insensitive, and safe to share with the patient.
partner_referencestring or nullYour own reference, if you sent one.
environmentstringsandbox or live.
statusstringThe public status. See Statuses.
patientobjectContact details as stored: first_name, last_name, phone (always E.164), email, city, state, area, preferred_language. Webhooks never include this block.
clinicalobjectcondition, priority, recommended_sessions, referring_clinician. clinical.notes is write-only and never returned.
careobjectpreferred_mode and preferred_contact_channel.
billing_modestringpatient_self_pay, hmo_direct_billing or corporate_sponsored.
providerobject or nullnull until a physiotherapist is matched. Then { "name": "Chiamaka Obi", "license_number": "MRTBN/PT/12345" }, where license_number may be null. In sandbox: { "name": "Sandbox Physiotherapist", "license_number": "SANDBOX-0001" }.
sessionsobjectcompleted (sessions attended), total (sessions prescribed), last_session_at, next_session_at.
links.tracking_urlstringThe public status page for this referral. It shows only the status timeline, with no personal or clinical data.
links.whatsapp_intake_urlstringOpens WhatsApp with Joy, pre-filled with START <tracking_code>. Give it to the patient so they can start intake straight away.
metadataobjectThe metadata you sent, echoed back.
created_at, updated_atstringISO-8601 UTC timestamps.

Statuses

A referral's status is always one of these eight values:

StatusMeaning
receivedRehabify accepted the referral.
contactedThe care team or Joy reached the patient, and intake has started.
bookedThe first appointment is confirmed.
in_treatmentRehabilitation sessions are under way.
completedThe care episode is complete and the patient has been discharged.
not_suitableRehabify's services aren't appropriate for this patient, who has been redirected to appropriate care. No clinical detail is disclosed.
cancelledThe referral or booking was cancelled or refunded.
closedNo further activity is expected.

Every status change fires a webhook named after the new status, such as referral.booked.

Create a referral

POST /partners/referrals

Creates a referral and returns it with status received. In live, Rehabify's care team and Joy then contact the patient.

Headers: Authorization, Content-Type: application/json, and Idempotency-Key. The idempotency key is optional but strongly recommended. See Idempotency.

Request body

FieldTypeRequiredRules
partner_referencestringNo1–100 characters. Unique per partner per environment. Reusing one returns 409 duplicate_partner_reference.
patient.first_namestringYes1–100 characters.
patient.last_namestringNoUp to 100 characters.
patient.phonestringYesE.164 (+2348012345678) or Nigerian local format (08012345678, 2348012345678). Stored and returned as E.164.
patient.emailstringNoA valid email address.
patient.city, patient.state, patient.areastringNoUp to 100 characters each.
patient.preferred_languagestringNoen, yo, ig or ha.
clinical.conditionstringNoUp to 200 characters, for example Lower back pain.
clinical.notesstringNoUp to 5,000 characters. Write-only: stored for Rehabify clinicians, and never returned by the API or webhooks.
clinical.prioritystringNostandard (default) or urgent.
clinical.recommended_sessionsintegerNo1–52. Default 4.
clinical.referring_clinicianstringNoUp to 200 characters.
care.preferred_modestringNoremote, in_person or patient_choice (default).
care.preferred_contact_channelstringNowhatsapp (default), phone, email or sms.
billing_modestringNopatient_self_pay (default), hmo_direct_billing or corporate_sponsored.
consent.grantedbooleanYesMust be true. By setting it, you confirm the patient agreed to be contacted by Rehabify. Anything else returns 422 consent_required.
consent.methodstringNoUp to 50 characters, for example electronic.
consent.captured_atstringNoISO-8601 timestamp of when consent was captured.
consent.privacy_notice_versionstringNoUp to 50 characters.
metadataobjectNoUp to 20 keys (each up to 40 characters) with string values (each up to 500 characters). Echoed back on the referral and in webhooks.

Unknown fields are ignored. Use partner_reference for your own ID. There is no external_ref field.

Example

curl https://api.physioaroundme.com/v1/partners/referrals \
  -X POST \
  -H "Authorization: Bearer $REHABIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 3f8a2c71-5e4b-4d9a-b6c2-7e1f0a9d8c3b" \
  -d '{
    "partner_reference": "HMO-REF-2026-0091",
    "patient": {
      "first_name": "Adeola",
      "last_name": "Balogun",
      "phone": "+2348012345678",
      "email": "adeola@example.com",
      "city": "Lagos",
      "state": "Lagos",
      "area": "Ikeja",
      "preferred_language": "en"
    },
    "clinical": {
      "condition": "Lower back pain",
      "notes": "L4-L5 disc bulge on MRI. No red flags.",
      "priority": "standard",
      "recommended_sessions": 6,
      "referring_clinician": "Dr. Okafor"
    },
    "care": { "preferred_mode": "patient_choice", "preferred_contact_channel": "whatsapp" },
    "billing_mode": "hmo_direct_billing",
    "consent": {
      "granted": true,
      "method": "electronic",
      "captured_at": "2026-10-13T09:00:00.000Z",
      "privacy_notice_version": "2026-09-01"
    },
    "metadata": { "member_plan": "gold" }
  }'

Response

201 Created returns the referral object shown above, with status set to received and provider set to null. A replayed request (same Idempotency-Key, same body) returns the original response with the header Idempotent-Replayed: true.

Errors

HTTPCodeWhen
400invalid_jsonThe body isn't valid JSON.
401missing_api_key, invalid_api_keyThe key is missing, unknown or revoked.
403partner_inactive, production_access_requiredYour organisation or production access isn't approved.
409duplicate_partner_referenceThe partner_reference already exists in this environment. error.existing holds id and tracking_code.
409idempotency_request_in_progressA request with the same Idempotency-Key is still processing.
422validation_errorA field failed validation. param names it.
422consent_requiredconsent.granted isn't true.
422patient_ineligibleSandbox only: patient.phone is +2348000000004. No referral is created.
422idempotency_key_reusedThe same Idempotency-Key was used with a different body.
429rate_limit_exceededToo many requests. Respect Retry-After.

What happens next

In live, Rehabify's care team and Joy contact the patient on their preferred channel. Give the patient links.whatsapp_intake_url, by SMS, email or in your app, so they can start straight away. Every status change is pushed to your webhook endpoint: referral.created fires immediately, then referral.contacted, referral.provider_matched, referral.booked, and so on.

In sandbox, nobody is contacted. Use magic phone numbers or the advance endpoint to simulate progress.

List referrals

GET /partners/referrals

Returns your referrals in the key's environment, newest first, as a paginated list.

Query parameters

ParameterTypeDescription
limitinteger1–100. Default 25.
cursorstringThe next_cursor from the previous page.
statusstringOnly referrals in this public status.
partner_referencestringOnly the referral with this partner_reference.
created_afterstringISO-8601 timestamp. Only referrals created after this time.
created_beforestringISO-8601 timestamp. Only referrals created before this time.

An invalid value returns 400 invalid_parameter with param set.

curl "https://api.physioaroundme.com/v1/partners/referrals?status=in_treatment&created_after=2026-10-01T00:00:00.000Z&limit=50" \
  -H "Authorization: Bearer $REHABIFY_API_KEY"
200 OK
{
  "object": "list",
  "data": [
    {
      "object": "referral",
      "id": "jd7f3k2m9x1q8w4e5r6t7y8u9i0o1p2a",
      "tracking_code": "RHB-4829173655",
      "partner_reference": "HMO-REF-2026-0091",
      "environment": "live",
      "status": "in_treatment",
      "patient": {
        "first_name": "Adeola",
        "last_name": "Balogun",
        "phone": "+2348012345678",
        "email": "adeola@example.com",
        "city": "Lagos",
        "state": "Lagos",
        "area": "Ikeja",
        "preferred_language": "en"
      },
      "clinical": {
        "condition": "Lower back pain",
        "priority": "standard",
        "recommended_sessions": 6,
        "referring_clinician": "Dr. Okafor"
      },
      "care": { "preferred_mode": "patient_choice", "preferred_contact_channel": "whatsapp" },
      "billing_mode": "hmo_direct_billing",
      "provider": { "name": "Chiamaka Obi", "license_number": "MRTBN/PT/12345" },
      "sessions": {
        "completed": 2,
        "total": 6,
        "last_session_at": "2026-10-18T10:00:00.000Z",
        "next_session_at": "2026-10-22T10:00:00.000Z"
      },
      "links": {
        "tracking_url": "https://physioaroundme.com/track/RHB-4829173655",
        "whatsapp_intake_url": "https://wa.me/2348061525811?text=START%20RHB-4829173655"
      },
      "metadata": { "member_plan": "gold" },
      "created_at": "2026-10-13T09:30:00.000Z",
      "updated_at": "2026-10-18T10:47:00.000Z"
    }
  ],
  "has_more": true,
  "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0xMC0xM1QwOTozMDowMC4wMDBaIn0"
}

Retrieve a referral

GET /partners/referrals/{id}

{id} can be the referral's id, its tracking_code (case-insensitive), or your partner_reference. URL-encode a partner_reference that contains special characters.

# By tracking code; the id or your partner_reference work the same way
curl https://api.physioaroundme.com/v1/partners/referrals/RHB-4829173655 \
  -H "Authorization: Bearer $REHABIFY_API_KEY"

Response: 200 OK with the referral object.

Errors: 404 referral_not_found when nothing matches in this environment. This includes referrals that belong to another partner or to the other environment.

Referrals | Rehabify Docs | Physio Around Me by Rehabify Health