Skip to main content
POST
Upload a document
Documents are processed asynchronously. You’ll receive a webhook notification when the upload is complete or if there was an error. To prevent new upload attempts after a caller-selected deadline, include an optional multipart form field such as -F 'expires_at=2027-06-15T14:30:00Z'. The timestamp must be in the future and include a timezone offset. Expiry reports EXPIRED on document.upload_failed; an upload already in progress may finish afterward. See Request Expiration.

Example Requests

To attach the document to an existing referral or order instead of a folder, send association_type and association_id (the Cobalt id from GET /v1/referrals or GET /v1/orders) in place of folder_name:
To route the document to a staff member for review, send emr_assigned_to_id. This is the EMR-native staff ID, not a Cobalt ID. Valid IDs are the ehr_id values returned by GET /v1/staff.

Example Response

Example Success Webhook

Example Failure Webhook

Authorizations

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

Body

multipart/form-data
document
file
required

The document file to upload (PDF, JPEG, or PNG; max 30MB).

patient_mrn
string
required

Medical Record Number of the patient the document is for.

Example:

"12345"

folder_name
string

Destination folder in the EMR. Either folder_name or template_name is required; EMRs that do not use template_name require folder_name.

Example:

"Lab Results"

template_name
string

Destination template in the EMR (max 255 chars). Either folder_name or template_name is required; EMRs that do not use template_name require folder_name.

Example:

"Progress Note"

emr_assigned_to_id
string

EMR staff ID to assign the document to. Validated against the account’s staff; valid ids are the ehr_id values from GET /v1/staff.

Example:

"staff-123"

review_required
string

Whether the document should be flagged for review in the EMR. One of: "true", "false" (default). Where the EMR files documents closed, "false" closes the document and "true" leaves it in review for provider_id (or the practice).

Example:

"false"

notes
string

Free-text notes for the document (max 1000 characters).

Example:

"Please review before the next visit."

is_high_priority
string

Whether the document is high priority. One of: "true", "false".

Example:

"false"

location_id
string

EMR location ID (department) the document belongs to. Validated against the account’s locations.

Example:

"location-1"

tags

Tags to attach to the document. Repeat the field for multiple tags.

Example:
provider_id
string

EMR provider ID to file the document under; the provider ehr_id from GET /v1/providers. With review_required "true" the document is left in REVIEW for this provider.

Example:

"PROV-1"

document_label
string

Document label (shown as the document title), matched by name, case-insensitive, against the labels the EMR allows for folder_name. Required unless review_required is "true".

Example:

"FAX CONFIRMATION"

document_date
string

Document date (YYYY-MM-DD).

Example:

"2026-06-15"

association_type
enum<string>

Attach the document to an existing entity instead of a chart folder. One of: "referral", "order". When set, association_id is required and folder_name/template_name must be omitted. eClinicalWorks only.

Available options:
referral,
order
Example:

"referral"

association_id
string

Cobalt id of the entity to attach to (the referral id from GET /v1/referrals, or the order id from GET /v1/orders). Required when association_type is set.

Example:

"f47ac10b58cc4372a5670e02b2c3d479"

callback_urls

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

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

Document uploaded and queued for delivery

success
boolean
required
Example:

true

message
string
required
Example:

"Document uploaded and queued for delivery"

document_id
string
required
Example:

"f47ac10b58cc4372a5670e02b2c3d479"

job_id
required
Example:

12345