Skip to main content
GET
/
documents
/
{id}
Get Document
curl --request GET \
  --url https://api.usecobalt.com/v1/documents/{id} \
  --header 'access_token: <api-key>' \
  --header 'client_id: <api-key>' \
  --header 'client_secret: <api-key>'
"<string>"
Returns the raw file bytes for a document. The response is the file itself — the Content-Type header carries the document’s MIME type and Content-Disposition carries the original filename. This endpoint is typically used to retrieve PDFs referenced by document_ids on a referral. The ID passed in the URL is the same value that appears in the document_ids array on a referral object.

Path Parameters

  • id (string, required): The Cobalt document ID (UUID without dashes) as returned in document_ids on a referral.

Example Request

curl -X GET "https://api.usecobalt.com/v1/documents/b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token" \
  --output document.pdf

Response

On success, the response body is the raw file. Relevant headers:
  • Content-Type: The document’s MIME type (typically application/pdf).
  • Content-Disposition: attachment; filename="<original-filename>".
  • Content-Length: The file size in bytes.
On failure, the response is JSON:
{
    "success": false,
    "message": "Document not found"
}

Status Codes

  • 200: Document returned successfully.
  • 404: Document not found.

Notes

  • Access is scoped to your organization — only documents associated with your linked accounts are returned.
  • Documents are stored as they were received from the EMR. PDFs are returned unmodified.

Authorizations

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

Path Parameters

id
string
required

The Cobalt document ID (UUID without dashes) as returned in document_ids on a referral.

Response

The document file.

The response is of type file.