Upload Document
/extract
Upload Document
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:
- PDF files only (
.pdfextension) - Maximum file size: 50MB (recommended)
- Documents are processed and validated upon upload
Document Processing:
- File size and page count are automatically calculated
- Document is validated for PDF format and readability
- Metadata is extracted and stored for future reference
- Document is stored securely and can be referenced by ID
Usage:
After uploading, you’ll receive a document_id that can be used with:
POST /jobsendpoint to start extraction jobsGET /documents/{document_id}to retrieve document informationDELETE /documents/{document_id}to remove the document
Example Response:
{
"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"
}
POST
Upload Document
Documentation Index
Fetch the complete documentation index at: https://docs.contextual.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Response
Successful Response
Response model for document upload.
Unique ID of the uploaded document
Original filename of the uploaded document
File size in bytes
Number of pages in the document
Timestamp when the document was uploaded
Upload status