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

# Get Document

> Fetch a single document by ID

This endpoint fetches a single document by ID, including metadata and a signed URL for accessing the document.

## Path Parameters

<ParamField path="documentId" type="string" required>
  The unique identifier of the document
</ParamField>

<ParamField query="includeContent" path="documentId" type="boolean">
  Optional. Whether to include the document’s base64-encoded content in the response
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier for the document
</ResponseField>

<ResponseField name="filename" type="string">
  Original filename
</ResponseField>

<ResponseField name="mimeType" type="string">
  MIME type of the document (e.g., "application/pdf", "image/jpeg")
</ResponseField>

<ResponseField name="size" type="number">
  File size in bytes
</ResponseField>

<ResponseField name="leadId" type="string">
  ID of the lead this document belongs to
</ResponseField>

<ResponseField name="workspaceId" type="string">
  ID of the workspace this document belongs to
</ResponseField>

<ResponseField name="signedUrl" type="string">
  Pre-signed URL for accessing the document (expires after 1 hour)
</ResponseField>

<ResponseField name="content" type="string">
  Base64-encoded document content
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp when the document was created
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp when the document was last updated
</ResponseField>

<Note>
  Signed URLs expire after 1 hour. Use this API again to get a fresh signed URL.
</Note>

<RequestExample>
  ```javascript Node.js theme={null}
  const documentId = 'd29176d4-25c6-4345-852d-0792e3812c70';
  const options = {
    method: 'GET',
    headers: {
      'x-api-key': '<your-api-key>',
    },
  };

  fetch(`https://api-v2.getomni.ai/api/v1/documents/${documentId}`, options)
    .then((response) => response.json())
    .then((response) => console.log(response))
    .catch((err) => console.error(err));
  ```

  ```python Python theme={null}
  import requests

  document_id = 'd29176d4-25c6-4345-852d-0792e3812c70'
  url = f"https://api-v2.getomni.ai/api/v1/documents/{document_id}"
  headers = {
      "x-api-key": "<your-api-key>"
  }

  response = requests.request("GET", url, headers=headers)
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api-v2.getomni.ai/api/v1/documents/d29176d4-25c6-4345-852d-0792e3812c70 \
    --header 'x-api-key: <your-api-key>'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "d29176d4-25c6-4345-852d-0792e3812c70",
    "filename": "omniai-technology-inc-8961-monthly-statement-2025-05.pdf",
    "mimeType": "application/pdf",
    "size": 131777,
    "leadId": "4cc8af99-b313-4c1f-b98b-009f38a4721a",
    "workspaceId": "6048d78a-584a-4f1e-9e39-e011ca4cc48c",
    "signedUrl": "https://omniai-server-v2-dev.s3.us-east-2.amazonaws.com/...",
    "createdAt": "2025-10-30T20:07:24.663Z",
    "updatedAt": "2025-10-30T20:08:20.033Z"
  }
  ```
</ResponseExample>
