Skip to main content
POST
Live-fetch appointments
This is a slow operation that fetches up-to-date appointment data directly from the EMR system. If the newest data is not critical, consider using the GET /appointments endpoint instead for faster results from cached data.

Search Modes

Date Range (default)

Fetches appointments for a date range (max 7 days). Results are synced to the database and returned via webhook.

MRN

Fetches all appointments for a specific patient by MRN, enriched with created_at and created_by timestamps.

Provider

Fetches appointments for one or more providers in a single EMR call. Results are synced to the database (scoped to the requested providers) and returned via webhook.
  • provider_ids: required array of EMR provider IDs (max 10)
  • 1 provider: end_date may be up to 5 days after start_date
  • 2-10 providers: start_date must equal end_date

Visit Notes

Where the EMR supports it, each appointment in the webhook has a visit_note_document_id: the Cobalt document ID of the encounter’s visit note. Pass it to POST /documents/fetch to get the note as a PDF. The same encounter has the same ID in the appointment and patient live fetches.

Webhook Notifications

When the appointment fetch is complete, we will send a webhook to your registered endpoint.

Date Range Webhook

When the request includes ehr_audit_log, each appointment also carries created_at, created_by, and an ehr_audit_log array of every field change (who changed it, when, and old → new):

MRN Webhook

Provider Webhook

Each appointment uses the same shape as the Date Range Webhook above.

Authorizations

client_id
string
header
required
client_secret
string
header
required
access_token
string
header
required

Body

application/json
search_by
enum<string>
default:date_range

Search mode. Defaults to date_range.

Available options:
date_range,
mrn,
provider
Example:

"date_range"

start_date
string<date>

Start of the date range (YYYY-MM-DD). Required for date_range and provider modes.

Example:

"2026-06-15"

end_date
string<date>

End of the date range (YYYY-MM-DD). Required for date_range and provider modes.

Example:

"2026-06-15"

mrn
string

Patient MRN. Required for mrn mode.

Example:

"12345"

provider_ids
string[]

EMR provider IDs (1-10). Required for provider mode.

Example:
include
enum<string>

Additional data to enrich each appointment with, as a comma-separated string or an array of tokens. Works in every search mode. Accepted tokens depend on the EMR (see x-allowed-values-for-emrs). ehr_audit_log returns the appointment change history (who changed which field from what to what, and when) plus created_at and created_by; one log lookup per appointment. schedule_blocks also returns schedule block rows (appointment_type schedule_block, with schedule_block_label and schedule_block_color); not supported with search_by=mrn.

Available options:
ehr_audit_log,
appointment_notes,
referral,
progress_note,
insurances,
schedule_blocks
Example:

"ehr_audit_log"

callback_urls

URL(s) to receive the completion webhook for this live fetch.

Example:
expires_at
string<date-time> | null

Optional ISO 8601 timestamp with an explicit timezone offset, in the future when submitted. Cobalt starts no new operation attempt after this deadline and reports reasons[].code EXPIRED. An attempt already in progress, including write reconciliation, may finish after it.

Example:

"2027-06-15T14:30:00Z"

Response

Live fetch request accepted

success
boolean
required
Example:

true

message
string
required
Example:

"Live fetch request accepted"

job_id
integer
Example:

12345