Skip to main content
POST
/
patients
{
  "firstName": "John",
  "lastName": "Doe",
  "phoneNumber": "+61412345678",
  "email": "john.doe@example.com",
  "dateOfBirth": "1990-01-15",
  "addressLine1": "123 Main St",
  "addressLine2": "Apt 4B",
  "suburb": "Melbourne",
  "state": "VIC",
  "postcode": "3000",
  "country": "AU"
}
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "+61412345678",
    "email": "john.doe@example.com",
    "dateOfBirth": "1990-01-15",
    "addressLine1": "123 Main St",
    "addressLine2": "Apt 4B",
    "suburb": "Melbourne",
    "state": "VIC",
    "postcode": "3000",
    "country": "AU",
    "organisationId": "org-uuid-here",
    "isIdentified": true,
    "createdAt": "2025-12-03T10:30:00.000Z",
    "updatedAt": "2025-12-03T10:30:00.000Z"
  },
  "meta": {}
}

Request Body

firstName
string
required
Patient’s first name. Min 1 character, max 255 characters.
lastName
string
required
Patient’s last name. Min 1 character, max 255 characters.
phoneNumber
string
required
Phone number in E.164 format. Must start with + followed by country code and number. Examples: - Australia: +61412345678 - US: +14155551234 - UK: +447700900123
dateOfBirth
string
required
Date of birth in ISO 8601 format (YYYY-MM-DD). Example: 1990-01-15
email
string
Valid email address for the patient.
addressLine1
string
Street address line 1. Max 255 characters.
addressLine2
string
Street address line 2 (apartment, suite, etc.). Max 255 characters.
suburb
string
Suburb or city. Max 100 characters.
state
string
State or province. Max 50 characters.
postcode
string
Postal or ZIP code. Max 20 characters.
country
string
Country code. Currently only AU (Australia) is supported.

Response

data
object
The created patient object.
meta
object
Additional metadata (currently empty).

Examples

const response = await fetch(
  "https://api.demo.operahealth.ai/api/v1/patients",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer opera_demo_your_api_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      firstName: "John",
      lastName: "Doe",
      phoneNumber: "+61412345678",
      email: "john.doe@example.com",
      dateOfBirth: "1990-01-15",
      addressLine1: "123 Main St",
      suburb: "Melbourne",
      state: "VIC",
      postcode: "3000",
      country: "AU",
    }),
  }
);

if (!response.ok) {
  const error = await response.json();
  console.error("Error:", error);
  throw new Error(error.detail);
}

const { data } = await response.json();
console.log("Patient created:", data);
{
  "firstName": "John",
  "lastName": "Doe",
  "phoneNumber": "+61412345678",
  "email": "john.doe@example.com",
  "dateOfBirth": "1990-01-15",
  "addressLine1": "123 Main St",
  "addressLine2": "Apt 4B",
  "suburb": "Melbourne",
  "state": "VIC",
  "postcode": "3000",
  "country": "AU"
}
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "+61412345678",
    "email": "john.doe@example.com",
    "dateOfBirth": "1990-01-15",
    "addressLine1": "123 Main St",
    "addressLine2": "Apt 4B",
    "suburb": "Melbourne",
    "state": "VIC",
    "postcode": "3000",
    "country": "AU",
    "organisationId": "org-uuid-here",
    "isIdentified": true,
    "createdAt": "2025-12-03T10:30:00.000Z",
    "updatedAt": "2025-12-03T10:30:00.000Z"
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

API key authentication using Bearer scheme. Get your API key from the Operahealth dashboard.

Body

application/json
firstName
string
required

Patient's first name

Required string length: 1 - 255
lastName
string
required

Patient's last name

Required string length: 1 - 255
phoneNumber
string
required

Phone number in E.164 format (e.g., +61412345678)

Pattern: ^\+[1-9]\d{1,14}$
dateOfBirth
string<date>
required

Date of birth in ISO 8601 format (YYYY-MM-DD)

email
string<email> | null

Patient's email address

addressLine1
string | null

Street address line 1

Maximum string length: 255
addressLine2
string | null

Street address line 2 (apartment, suite, etc.)

Maximum string length: 255
suburb
string | null

Suburb or city

Maximum string length: 100
state
string | null

State or province

Maximum string length: 50
postcode
string | null

Postal or ZIP code

Maximum string length: 20
country
enum<string> | null

Country code (only Australia supported)

Available options:
AU

Response

Patient created successfully

data
object
meta
object

Additional metadata