Skip to main content
POST
/
calendar
/
self-schedule
/
get-or-create-patient
Get Or Create Patient
curl --request POST \
  --url https://api.decodahealth.com/calendar/self-schedule/get-or-create-patient \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "firstName": "<string>",
  "lastName": "<string>",
  "phoneNumber": "<string>"
}
'
{
  "id": "<string>",
  "patientStatus": "NEW",
  "firstName": "<string>",
  "lastName": "<string>",
  "phoneNumber": "<string>",
  "email": "<string>",
  "type": "PATIENT",
  "locationId": "<string>",
  "dateOfBirth": "2023-12-25",
  "onSchedulingBlacklist": true,
  "futureAppointment": {
    "id": "<string>",
    "title": "<string>",
    "start": "2023-11-07T05:31:56Z",
    "end": "2023-11-07T05:31:56Z",
    "type": "APPOINTMENT",
    "status": "PENDING",
    "location": {
      "id": "<string>",
      "isVirtual": true
    },
    "attendees": [],
    "recurringEventId": "<string>",
    "recurringEvent": {
      "id": "<string>",
      "rrule": "<string>",
      "startDate": "2023-11-07T05:31:56Z",
      "durationMinutes": 123,
      "timezone": "<string>",
      "type": "APPOINTMENT",
      "title": "<string>",
      "organizerId": "<string>",
      "serviceIds": [
        "<string>"
      ],
      "capacity": 123,
      "attendeeIds": [
        "<string>"
      ],
      "locationId": "<string>"
    },
    "eventServices": [],
    "icons": [],
    "capacity": 123
  },
  "hasPaymentMethod": false
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json
firstName
string
required
Minimum string length: 1
lastName
string
required
Minimum string length: 1
phoneNumber
string
required

Response

Successful Response

id
string
required

The unique identifier for the user.

patientStatus
enum<string>
required
Available options:
NEW,
EXISTING,
RETURNING
firstName
string | null

The user's first name.

lastName
string | null

The user's last name.

phoneNumber
string | null

The user's phone number.

email
string | null

The user's email address.

type
enum<string>
default:PATIENT

The type of user.

Available options:
PROVIDER,
PATIENT,
ASSISTANT
locationId
string | null

The location of the user.

dateOfBirth
string<date> | null

The date of birth of the patient.

onSchedulingBlacklist
boolean | null

Whether the patient is on the scheduling blacklist.

futureAppointment
EventTiny · object
hasPaymentMethod
boolean
default:false