> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecobalt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Document

> Download a document by its Cobalt ID.

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

```bash theme={null}
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:

```json theme={null}
{
    "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.


## OpenAPI

````yaml GET /documents/{id}
openapi: 3.0.0
info:
  title: Cobalt API
  version: 1.0.1
  description: API for interacting with Cobalt's EHR integration services
servers:
  - url: https://api.usecobalt.com/v1
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /documents/{id}:
    get:
      summary: Get Document
      description: >-
        Download a document by its Cobalt ID. Returns the raw file bytes with
        the original MIME type in the Content-Type header.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: >-
            The Cobalt document ID (UUID without dashes) as returned in
            document_ids on a referral.
      responses:
        '200':
          description: The document file.
          headers:
            Content-Type:
              description: MIME type of the document (e.g., application/pdf).
              schema:
                type: string
            Content-Disposition:
              description: attachment; filename="<original-filename>"
              schema:
                type: string
            Content-Length:
              description: File size in bytes.
              schema:
                type: integer
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: Document not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
components:
  securitySchemes:
    ClientCredentials:
      type: apiKey
      in: header
      name: client_id
    ClientSecret:
      type: apiKey
      in: header
      name: client_secret
    AccessToken:
      type: apiKey
      in: header
      name: access_token

````