Skip to main content
POST
Fetch a document
Queues an on-demand fetch of a document’s file from the EMR. This is asynchronous: the endpoint returns a job_id, Cobalt retrieves the file from the EMR and stores it, then sends a document.live_fetch_completed webhook. Retrieve the file with GET /documents/.

Getting a document_id

Use the document_id returned by Cobalt for an EMR document, for example on the chart documents in a patient live fetch response. Supported sources vary by EMR.

Flow

  1. POST /documents/fetch with a document_id returns 202 and a job_id.
  2. Cobalt fetches the file from the EMR and stores it.
  3. A document.live_fetch_completed webhook is sent with the document reference.
  4. GET /documents/{id} returns the file.

Example Request

Status Codes

  • 202: Fetch accepted; the document is delivered via webhook and retrievable at GET /documents/{id}.
  • 400: Missing or invalid document_id, or the connected EMR is not supported.

Authorizations

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

Body

application/json
document_id
string
required

Cobalt document id identifying the EMR document to fetch (e.g. from the patient live-fetch response).

Example:

"swf1_eyJtIjoiMjg3IiwiZiI6IjI2IiwiaSI6IjEwNDE5NTE3NyJ9"

callback_urls
string[]

URLs to receive the completion webhook for this fetch, in addition to the account webhook.

Example:

Response

Document fetch accepted

success
boolean
required
message
string
required
job_id
required