---
title: "Upload Document"
method: POST
path: "/extract/documents/upload"
tags: ["/extract"]
---

# Upload Document

`POST /extract/documents/upload`

Upload a document for structured extraction.

Uploads a PDF document that can be used for structured data extraction. Only PDF files are supported.

Supported File Types: 1. PDF files only (.pdf extension) 2. Maximum file size: 50MB (recommended) 3. Documents are processed and validated upon upload

Document Processing: 1. File size and page count are automatically calculated 2. Document is validated for PDF format and readability 3. Metadata is extracted and stored for future reference 4. Document is stored securely and can be referenced by ID

Usage: After uploading, you'll receive a document_id that can be used with: 1. /jobs endpoint to start extraction jobs 2. /documents/{document_id} to retrieve document information 3. /documents/{document_id} DELETE to remove the document

Example Response:
```json
{
  "document_id": "123e4567-e89b-12d3-a456-426614174000",
  "file_name": "financial_report.pdf",
  "file_size": 2048576,
  "page_count": 45,
  "uploaded_at": "2025-01-11T18:35:00Z",
  "status": "uploaded"
}
```

## Response `200`

Successful Response

- DocumentUploadResponse — Response model for document upload.
  - `document_id` string, required — Unique ID of the uploaded document
  - `file_name` string, required — Original filename of the uploaded document
  - `file_size` integer, required — File size in bytes
  - `page_count` integer, required — Number of pages in the document
  - `uploaded_at` string, required — Timestamp when the document was uploaded
  - `status` string, required — Upload status

## Other responses

- `422` — Validation Error

## Changes

- **2025-10-28** `c8152db45500` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/contextualai/apis/endpoints/changes/extract/documents/upload/post.md)

---

[API](https://skmtc.dev/contextualai/apis/endpoints.md) · [All operations](https://skmtc.dev/contextualai/apis/endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/contextualai/endpoints/revisions/c8152db45500/schema)
