# Batch document extraction Process multiple documents in parallel with a single schema. #### Request Body **`files`** file[] required Array of document files to process. Maximum 50 files per batch. Each file must be under 50 MB. **`schema`** string required JSON schema as string. All documents will be processed with the same schema. **`organization_id`** string required Your organization ID. **`prompt`** string optional Custom extraction instructions applied to all documents. **`model`** string optional · Defaults to `ftg-3.0` Model selection: `ftg-3.0`, `gpt-4o`, or `gpt-4o-mini`. **`vision_model`** string optional · Defaults to `gpt-5` Vision analysis model for processing images and PDFs. Used for OCR and visual understanding. ## Returns Returns a batch object with job IDs for each document. Use the job IDs to check individual extraction status. Python ```python import requests import json API_URL = "https://api.aitronos.com/v1/documents/extract/batch" TOKEN = "your_bearer_token_here" headers = {"Authorization": f"Bearer {TOKEN}"} schema = { "properties": { "invoice_number": {"type": "string"}, "total_amount": {"type": "number"} } } files = [ ("files", open("invoice1.pdf", "rb")), ("files", open("invoice2.pdf", "rb")), ("files", open("invoice3.pdf", "rb")) ] data = { "schema": json.dumps(schema), "organization_id": "org_abc123", "model": "gpt-4o-mini" } response = requests.post(API_URL, headers=headers, files=files, data=data) result = response.json() if result['success']: print(f"Batch submitted with {len(result['job_ids'])} jobs") for job_id in result['job_ids']: print(f"Job ID: {job_id}") ``` Bash ```bash curl -X POST https://api.aitronos.com/v1/documents/extract/batch \ -H "X-API-Key: $FREDDY_API_KEY" \ -F "files=@invoice1.pdf" \ -F "files=@invoice2.pdf" \ -F "files=@invoice3.pdf" \ -F 'schema={"properties":{"invoice_number":{"type":"string"},"total_amount":{"type":"number"}}}' \ -F "organization_id=org_abc123" ``` ## Response Example ```json { "success": true, "batch_id": "batch_abc123", "job_ids": [ "job_abc123def456", "job_def456ghi789", "job_ghi789jkl012" ], "total_documents": 3, "created_at": "2024-12-16T10:30:00Z" } ``` ## Related Resources - [Extract Document Data](/docs/api-reference/documents/extract) - [Get Job Status](/docs/api-reference/documents/get-job-status) - [Document Extraction Overview](/docs/api-reference/documents/introduction)