/extract
Upload Document
Changed onUpload 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 (.pdf extension)
- 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 /jobs endpoint to start extraction jobs
- GET /documents/{document_id} to retrieve document information
- DELETE /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/extract/documents/upload
Request
- Base URLhttps://api.contextual.ai/v1
- URLhttps://api.contextual.ai/v1/extract/documents/upload
- AuthHTTP bearer
Request body multipart/form-data
Response
Successful Response
Changes
- info
endpoint added
- info
- breaking
api path removed without deprecation
- breaking