RelayaRelayaDocs
Dashboard

Patients API

Manage patient records. Create, retrieve, and update patient information and history.

GET/v1/patients

Returns a paginated list of patients. Supports full-text search across name, phone, and email.

Query Parameters

ParameterTypeRequiredDescription
searchstringOptionalSearch by name, phone, or email
pageintegerOptionalPage number (default: 1)
limitintegerOptionalResults per page (default: 20, max: 100)

Example Request

curl -X GET "https://api.relaya.one/v1/patients?search=sharma" \
  -H "Authorization: Bearer rlya_live_abc123"

Example Response

{
  "data": [
    {
      "id": "pat_4jn7h2",
      "name": "Priya Sharma",
      "phone": "+919876543210",
      "email": "priya.sharma@email.com",
      "dob": "1990-03-15",
      "gender": "female",
      "created_at": "2026-01-10T08:00:00Z",
      "last_visit": "2026-07-20T10:30:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 1,
    "has_more": false
  }
}
POST/v1/patients

Register a new patient. Phone number must be unique across your clinic.

Request Body

ParameterTypeRequiredDescription
namestringRequiredFull name
phonestringRequiredPhone number (E.164 format)
emailstringOptionalEmail address
dobstringOptionalDate of birth (YYYY-MM-DD)
genderstringOptionalGender: male, female, other
addressstringOptionalMailing address
notesstringOptionalInternal notes

Example Request

curl -X POST "https://api.relaya.one/v1/patients" \
  -H "Authorization: Bearer rlya_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Rahul Verma",
    "phone": "+919812345678",
    "email": "rahul.verma@email.com",
    "dob": "1985-08-22",
    "gender": "male"
  }'
GET/v1/patients/:id

Retrieve a patient by ID, including their appointment history and recent visits.

Example Response

{
  "data": {
    "id": "pat_4jn7h2",
    "name": "Priya Sharma",
    "phone": "+919876543210",
    "email": "priya.sharma@email.com",
    "dob": "1990-03-15",
    "gender": "female",
    "address": "42 MG Road, Bengaluru",
    "created_at": "2026-01-10T08:00:00Z",
    "last_visit": "2026-07-20T10:30:00Z",
    "appointments": [
      {
        "id": "apt_8xk2m9v3",
        "datetime": "2026-07-20T10:30:00Z",
        "doctor_id": "doc_9km3p1",
        "status": "completed"
      }
    ],
    "stats": {
      "total_appointments": 12,
      "completed": 10,
      "cancelled": 2,
      "no_shows": 0
    }
  }
}
PATCH/v1/patients/:id

Update patient information. Only provided fields are modified.

Request Body

ParameterTypeRequiredDescription
namestringOptionalUpdated full name
phonestringOptionalUpdated phone (E.164 format)
emailstringOptionalUpdated email
addressstringOptionalUpdated address
notesstringOptionalUpdated internal notes

Error Codes

CodeStatusDescription
400bad_requestInvalid parameters or malformed phone number
401unauthorizedInvalid or missing API key
404not_foundPatient not found
409conflictPhone number already registered
429rate_limitedToo many requests