API Referencev1

Patients

The Patients API allows you to create, retrieve, update, and search patient records. Every patient record includes demographic information, contact details, and medical history references.

The Patient Object

All patient endpoints return or accept the following object structure:

FieldTypeDescription
idstringUnique patient identifier (pat_*)
first_namestringPatient's first name
last_namestringPatient's last name
emailstringEmail address (unique)
phonestringPhone number with country code
date_of_birthstringISO 8601 date (YYYY-MM-DD)
genderenummale, female, other
statusenumactive, inactive, archived
addressobjectStreet, city, state, postal_code, country
medical_historyarrayReferences to medical record entries
created_atstringISO 8601 timestamp (UTC)
updated_atstringISO 8601 timestamp (UTC)
GET/patients

List all patients

Returns a paginated list of patients. Use cursor-based pagination to retrieve subsequent pages. Results are sorted by created_at in descending order.

Parameters

ParameterTypeRequiredDescription
limitintegerOptionalNumber of results per page (1-100). Default: 20
cursorstringOptionalPagination cursor from a previous response
statusstringOptionalFilter by status: active, inactive, archived

Example Request

Requestbash
curl -X GET "https://api.odento.app/api/v1/patients?limit=10" \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567"

Example Response

Response200json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "pat_5f8d3a2b1c9e4a7b",
        "first_name": "Priya",
        "last_name": "Sharma",
        "email": "priya.sharma@example.com",
        "phone": "+919876543210",
        "date_of_birth": "1990-05-15",
        "gender": "female",
        "status": "active",
        "created_at": "2025-01-15T10:30:00Z",
        "updated_at": "2025-01-20T14:15:00Z"
      },
      {
        "id": "pat_3a7b9c1d2e5f8a4b",
        "first_name": "Rahul",
        "last_name": "Verma",
        "email": "rahul.verma@example.com",
        "phone": "+919876543211",
        "date_of_birth": "1985-08-22",
        "gender": "male",
        "status": "active",
        "created_at": "2025-01-14T09:00:00Z",
        "updated_at": "2025-01-14T09:00:00Z"
      }
    ],
    "pagination": {
      "has_more": true,
      "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNS0wMS0xNFQwOTowMDowMFoifQ==",
      "per_page": 10
    }
  }
}

Try It Out

API Playground
Headers
This is a simulated response — no real API calls are made from the browser.
POST/patients

Create a patient

Creates a new patient record. Email must be unique within the organization. Returns the created patient object.

Parameters

ParameterTypeRequiredDescription
first_namestringRequiredPatient first name
last_namestringRequiredPatient last name
emailstringRequiredUnique email address
phonestringRequiredPhone number with country code
date_of_birthstringOptionalISO 8601 date (YYYY-MM-DD)
genderstringOptionalmale, female, or other
addressobjectOptionalAddress object with street, city, state, postal_code, country

Example Request

Requestbash
curl -X POST https://api.odento.app/api/v1/patients \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Priya",
    "last_name": "Sharma",
    "email": "priya.sharma@example.com",
    "phone": "+919876543210",
    "date_of_birth": "1990-05-15",
    "gender": "female",
    "address": {
      "street": "12 MG Road",
      "city": "Bengaluru",
      "state": "Karnataka",
      "postal_code": "560001",
      "country": "India"
    }
  }'

Example Response

Response201json
{
  "success": true,
  "data": {
    "id": "pat_5f8d3a2b1c9e4a7b",
    "first_name": "Priya",
    "last_name": "Sharma",
    "email": "priya.sharma@example.com",
    "phone": "+919876543210",
    "date_of_birth": "1990-05-15",
    "gender": "female",
    "status": "active",
    "address": {
      "street": "12 MG Road",
      "city": "Bengaluru",
      "state": "Karnataka",
      "postal_code": "560001",
      "country": "India"
    },
    "medical_history": [],
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T10:30:00Z"
  }
}
GET/patients/{id}

Retrieve a patient

Retrieves the full patient record by ID, including medical history references.

Parameters

ParameterTypeRequiredDescription
idstringRequiredThe patient ID (pat_*)

Example Request

Requestbash
curl -X GET https://api.odento.app/api/v1/patients/pat_5f8d3a2b1c9e4a7b \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567"

Example Response

Response200json
{
  "success": true,
  "data": {
    "id": "pat_5f8d3a2b1c9e4a7b",
    "first_name": "Priya",
    "last_name": "Sharma",
    "email": "priya.sharma@example.com",
    "phone": "+919876543210",
    "date_of_birth": "1990-05-15",
    "gender": "female",
    "status": "active",
    "address": {
      "street": "12 MG Road",
      "city": "Bengaluru",
      "state": "Karnataka",
      "postal_code": "560001",
      "country": "India"
    },
    "medical_history": [
      {
        "id": "med_rec_abc123",
        "type": "diagnosis",
        "title": "Dental caries - upper left molar",
        "recorded_at": "2025-01-20T14:00:00Z"
      }
    ],
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-20T14:15:00Z"
  }
}
PATCH/patients/{id}

Update a patient

Updates the specified patient record. Only the fields included in the request body will be modified; all other fields remain unchanged.

Parameters

ParameterTypeRequiredDescription
idstringRequiredThe patient ID (pat_*)
first_namestringOptionalUpdated first name
last_namestringOptionalUpdated last name
phonestringOptionalUpdated phone number
addressobjectOptionalUpdated address object
statusstringOptionalUpdated status: active, inactive, archived

Example Request

Requestbash
curl -X PATCH https://api.odento.app/api/v1/patients/pat_5f8d3a2b1c9e4a7b \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+919876500000",
    "address": {
      "street": "45 Brigade Road",
      "city": "Bengaluru",
      "state": "Karnataka",
      "postal_code": "560025",
      "country": "India"
    }
  }'

Example Response

Response200json
{
  "success": true,
  "data": {
    "id": "pat_5f8d3a2b1c9e4a7b",
    "first_name": "Priya",
    "last_name": "Sharma",
    "email": "priya.sharma@example.com",
    "phone": "+919876500000",
    "date_of_birth": "1990-05-15",
    "gender": "female",
    "status": "active",
    "address": {
      "street": "45 Brigade Road",
      "city": "Bengaluru",
      "state": "Karnataka",
      "postal_code": "560025",
      "country": "India"
    },
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-22T08:45:00Z"
  }
}
GET/patients/search

Search patients

Search patients by name, email, phone, or any combination of fields. Returns matching patients ranked by relevance.

Parameters

ParameterTypeRequiredDescription
qstringRequiredSearch query (matches name, email, phone)
limitintegerOptionalMax results to return (1-50). Default: 10

Example Request

Requestbash
curl -X GET "https://api.odento.app/api/v1/patients/search?q=priya" \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567"

Example Response

Response200json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "pat_5f8d3a2b1c9e4a7b",
        "first_name": "Priya",
        "last_name": "Sharma",
        "email": "priya.sharma@example.com",
        "phone": "+919876543210",
        "status": "active"
      },
      {
        "id": "pat_9c2d4e7f1a3b6c8d",
        "first_name": "Priyanka",
        "last_name": "Gupta",
        "email": "priyanka.gupta@example.com",
        "phone": "+919876543220",
        "status": "active"
      }
    ],
    "total": 2
  }
}
DELETE/patients/{id}

Delete a patient

Permanently deletes a patient record. This action cannot be undone. The patient's medical history records are archived but not deleted.

Parameters

ParameterTypeRequiredDescription
idstringRequiredThe patient ID (pat_*)

Example Request

Requestbash
curl -X DELETE https://api.odento.app/api/v1/patients/pat_5f8d3a2b1c9e4a7b \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567"

Example Response

Response200json
{
  "success": true,
  "data": {
    "id": "pat_5f8d3a2b1c9e4a7b",
    "deleted": true
  }
}
GET/patients/{id}/records

List patient medical records

Retrieves all medical records associated with a patient, including diagnoses, treatments, prescriptions, and lab results.

Parameters

ParameterTypeRequiredDescription
idstringRequiredThe patient ID (pat_*)
typestringOptionalFilter by record type: diagnosis, treatment, prescription, lab_result
limitintegerOptionalResults per page (1-100). Default: 20
cursorstringOptionalPagination cursor

Example Request

Requestbash
curl -X GET "https://api.odento.app/api/v1/patients/pat_5f8d3a2b1c9e4a7b/records?type=diagnosis" \
  -H "X-API-Key-ID: ok_live_abc123def456ghi789jkl012" \
  -H "X-API-Key-Secret: os_abc123def456ghi789jkl012mno345pqr678stu901vwx234yzab567"

Example Response

Response200json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "med_rec_abc123",
        "type": "diagnosis",
        "title": "Dental caries - upper left molar",
        "description": "Class II caries on tooth #26 extending into dentin.",
        "icd10_code": "K02.1",
        "recorded_by": "usr_abc123",
        "recorded_at": "2025-01-20T14:00:00Z"
      },
      {
        "id": "med_rec_def456",
        "type": "diagnosis",
        "title": "Gingivitis - generalized",
        "description": "Generalized mild gingivitis with bleeding on probing.",
        "icd10_code": "K05.1",
        "recorded_by": "usr_abc123",
        "recorded_at": "2025-01-18T11:30:00Z"
      }
    ],
    "pagination": {
      "has_more": false,
      "next_cursor": null,
      "per_page": 20
    }
  }
}

Was this page helpful?

Help us improve our documentation