{"openapi":"3.1.0","info":{"title":"Extract","version":"1.0.0"},"paths":{"/api/extract":{"post":{"operationId":"extract_extract","summary":"Extract Document","description":"Extract structured data from a document using a configured extractor.\n\nUpload a document (PDF, image, or other supported format) along with an extractor ID,\nand receive the extracted data matching your extractor's schema.\n\n**File Input Options:**\n- **Binary upload**: Directly upload the file (max 4.5 MB)\n- **Base64**: Pass base64-encoded file content (max 4.5 MB)\n- **Data URL**: Pass a data URL (max 4.5 MB)\n- **URL**: Pass a publicly accessible URL to the document (up to 35 MB)\n\n**File Size Limits:**\nBinary, Base64, and Data URL inputs are limited to **4.5 MB** on the Pay As You Go plan.\nFor larger files up to **35 MB**, use the URL option.\nNeed higher limits? Contact sales at https://runautomat.com/contact","tags":["extract"],"responses":{"200":{"description":"Response with status 200","content":{"application/json":{"schema":{"$ref":"#/components/schemas/extract_ExtractResponse"}}}},"400":{"description":"The request is malformed or missing required fields.\nCheck that you've provided all required fields: `file` and `extractorId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/extract_ErrorResponse"}}}},"401":{"description":"The API key is missing, invalid, or has been revoked.\nEnsure you're using a valid API key in the `Authorization: Bearer <api_key>` header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/extract_ErrorResponse"}}}},"422":{"description":"The extraction could not be completed. This may occur if:\n- The extractor ID doesn't exist or you don't have access to it\n- The document format is not supported\n- The document could not be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/extract_ErrorResponse"}}}},"500":{"description":"An unexpected error occurred. Please try again or contact support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/extract_ErrorResponse"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"extractorId":{"type":"string","description":"The unique identifier of the extractor to use for extraction.\nYou can find this in the Automat dashboard or when creating an extractor via the API."},"file":{"type":"string","format":"binary","description":"The document to extract data from. Can be:\n- A binary file upload\n- A URL string (http:// or https://)\n- A base64-encoded string\n- A data URL string"},"mimeType":{"type":"string","description":"The MIME type of the file. Required when `file` is a string (URL, base64, or data URL).\nExamples: `application/pdf`, `image/png`, `image/jpeg`"},"filename":{"type":"string","description":"Optional filename for the document. If not provided, will be inferred from \nthe File object name or URL path."},"extractorVersionId":{"type":"string","description":"Pin extraction to a specific extractor version"},"config":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Override model configuration for this request"},"timeout":{"type":"integer","description":"Timeout in seconds (1-300)"}},"required":["extractorId","file"]}}}},"security":[{"BearerAuthScheme":[]}]}}},"tags":[{"name":"extract","description":"The Extract API allows you to extract structured data from documents using pre-configured extractors.\n\nExtractors define the schema and rules for pulling specific fields from your documents - \nwhether invoices, contracts, receipts, or any other document type."}],"servers":[{"url":"https://studio.runautomat.com","description":"Production"}],"components":{"schemas":{"extract_ExtractResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"description":"Any type"},"description":"The extracted data matching your extractor's schema.\nThe structure depends on how you configured your extractor."}},"required":["data"],"description":"Response from a successful extraction request","title":"ExtractResponse"},"extract_ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Machine-readable error code (e.g., \"bad_request\", \"unauthorized\")"},"message":{"type":"string","description":"Human-readable error message describing what went wrong"}},"required":["error","message"],"description":"Standard error response format","title":"ErrorResponse"}},"securitySchemes":{"BearerAuthScheme":{"type":"http","scheme":"bearer"}}}}