openapi: 3.2.0 info: title: B2B-OldKAIExtract Process File API description: 'Extract structured information from documents. ## Using the API ### Optional Parameters When using the ''Try it out'' feature in Swagger UI, optional parameters with empty values can be left as-is. The API handles empty strings and will treat them as if the parameter was omitted. You don''t need to remove empty optional fields from requests. **Tip:** In generated curl commands, you may see flags like `-F ''tag=''` or `-F ''tools=''`. These empty optional fields are safe to include or remove - the API treats them identically.' version: 0.1.0 servers: - url: https://gateway.api.kuehne-nagel.com/oldkaiextractapi/0.1.0 - url: http://gateway.api.kuehne-nagel.com:8280/oldkaiextractapi/0.1.0 security: - default: [] tags: - name: process-file description: Process individual files using LLM extraction with prompt templates. paths: /v2/process-file/: post: tags: - process-file summary: Post Process File V2 operationId: post_process_file_v2_v2_process_file__post parameters: - name: x-api-key in: header required: false style: simple explode: false schema: anyOf: - type: string - type: 'null' title: X-Api-Key - name: x-auth-request-email in: header required: false style: simple explode: false schema: anyOf: - type: string - type: 'null' title: X-Auth-Request-Email requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_v2_v2_process_file__post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v2/async/process-file/: post: tags: - process-file summary: Post Process File Async V2 operationId: post_process_file_async_v2_v2_async_process_file__post parameters: - name: x-api-key in: header required: false style: simple explode: false schema: anyOf: - type: string - type: 'null' title: X-Api-Key - name: x-auth-request-email in: header required: false style: simple explode: false schema: anyOf: - type: string - type: 'null' title: X-Auth-Request-Email requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_async_v2_v2_async_process_file__post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractAsyncResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/workspaces/{workspace_id}/process-file: post: tags: - process-file summary: Post Process File V3 description: Process a file and return extraction results using a specific prompt version. operationId: post_process_file_v3_v3_workspaces__workspace_id__process_file_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-auth-request-email in: header required: true style: simple explode: false schema: type: string title: X-Auth-Request-Email requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_v3_v3_workspaces__workspace_id__process_file_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/workspaces/{workspace_id}/process-file-with-prompt: post: tags: - process-file summary: Post Process File With Prompt V3 description: Process a file with a custom prompt string and return extraction results. operationId: post_process_file_with_prompt_v3_v3_workspaces__workspace_id__process_file_with_prompt_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-auth-request-email in: header required: true style: simple explode: false schema: type: string title: X-Auth-Request-Email requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_with_prompt_v3_v3_workspaces__workspace_id__process_file_with_prompt_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/process-file: post: tags: - process-file summary: Post Process File V3 Api Key description: Process a file using API key authentication with a specific prompt version. operationId: post_process_file_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/process-file-with-prompt: post: tags: - process-file summary: Post Process File With Prompt V3 Api Key description: Process a file with a custom prompt string using API key authentication. operationId: post_process_file_with_prompt_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_with_prompt_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/async/process-file: post: tags: - process-file summary: Post Process File Async V3 Api Key description: 'Process a file asynchronously using the Gemini LLM model with API key authentication. When enable_mep_output is set to True, the API will send a notification to the MEP connector upon successful completion of the async processing job.' operationId: post_process_file_async_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_async_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_post' required: true responses: '202': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractAsyncResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/process-file-verified: post: tags: - process-file summary: Post Process File Verified V3 Api Key description: 'Process a file multiple times concurrently for enhanced reliability using API key authentication. This endpoint executes the same file processing operation multiple times concurrently using different AI model sessions to ensure consistency and reliability of results for production use cases requiring high confidence. The endpoint: - Accepts a num_runs parameter (1-5) specifying the number of parallel executions - Executes multiple instances of the same file processing operation in parallel - Ensures each parallel execution receives an independent context/session - Returns a VerifiedProcessingResponse containing all individual processing results' operationId: post_process_file_verified_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_verified_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/Body_post_process_file_verified_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_verified_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VerifiedProcessingResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/workspaces/{workspace_id}/process-file-base64: post: tags: - process-file summary: Post Process File Base64 V3 description: Process a file from base64 content and return extraction results using a specific prompt version. operationId: post_process_file_base64_v3_v3_workspaces__workspace_id__process_file_base64_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-auth-request-email in: header required: true style: simple explode: false schema: type: string title: X-Auth-Request-Email requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_post_process_file_base64_v3_v3_workspaces__workspace_id__process_file_base64_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/workspaces/{workspace_id}/process-file-with-prompt-base64: post: tags: - process-file summary: Post Process File With Prompt Base64 V3 description: Process a file from base64 content with a custom prompt string and return extraction results. operationId: post_process_file_with_prompt_base64_v3_v3_workspaces__workspace_id__process_file_with_prompt_base64_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-auth-request-email in: header required: true style: simple explode: false schema: type: string title: X-Auth-Request-Email requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_post_process_file_with_prompt_base64_v3_v3_workspaces__workspace_id__process_file_with_prompt_base64_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/process-file-base64: post: tags: - process-file summary: Post Process File Base64 V3 Api Key description: Process a file from base64 content using API key authentication with a specific prompt version. operationId: post_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_base64_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_post_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_base64_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/process-file-with-prompt-base64: post: tags: - process-file summary: Post Process File With Prompt Base64 V3 Api Key description: Process a base64 encoded file with a custom prompt string using API key authentication. operationId: post_process_file_with_prompt_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_base64_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_post_process_file_with_prompt_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_base64_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/api-key-auth/workspaces/{workspace_id}/async/process-file-base64: post: tags: - process-file summary: Post Async Process File Base64 V3 Api Key description: Process a file from base64 content asynchronously using API key authentication with a specific prompt version. operationId: post_async_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_base64_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-api-key in: header required: true style: simple explode: false schema: type: string title: X-Api-Key requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_post_async_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_base64_post' required: true responses: '202': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExtractAsyncResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited /v3/workspaces/{workspace_id}/process-file-verified-base64: post: tags: - process-file summary: Post Process File Verified Base64 V3 description: Process a file from base64 content multiple times concurrently for verification using a specific prompt version. operationId: post_process_file_verified_base64_v3_v3_workspaces__workspace_id__process_file_verified_base64_post parameters: - name: workspace_id in: path required: true style: simple explode: false schema: type: string format: uuid title: Workspace Id - name: x-auth-request-email in: header required: true style: simple explode: false schema: type: string title: X-Auth-Request-Email requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_post_process_file_verified_base64_v3_v3_workspaces__workspace_id__process_file_verified_base64_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VerifiedProcessingResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited components: schemas: Body_post_process_file_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_post: type: object properties: file: type: string format: binary description: The document file to process (PDF, DOCX, TXT, etc.) title: File prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. example: title: Prompt Id prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce output schema validation. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific prompt version ID. Leave empty for latest. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select prompt version. Leave empty for latest. example: '' title: Tag max_retries: type: integer default: 1 description: 'Max retry attempts (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file - prompt_id title: Body_post_process_file_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_post VerifiedProcessingSummary: type: object description: Summary information for verified processing results. properties: total_runs: type: integer title: Total Runs successful_runs: type: integer title: Successful Runs failed_runs: type: integer title: Failed Runs total_processing_time: type: number title: Total Processing Time average_processing_time: type: number title: Average Processing Time started_at: type: string format: date-time title: Started At completed_at: type: string format: date-time title: Completed At required: - average_processing_time - completed_at - failed_runs - started_at - successful_runs - total_processing_time - total_runs title: VerifiedProcessingSummary HTTPValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/ValidationError' title: Detail title: HTTPValidationError Body_post_process_file_v2_v2_process_file__post: type: object properties: workspace: type: string title: Workspace file: type: string format: binary title: File prompt_name: type: string title: Prompt Name prompt_kwargs: anyOf: - type: string - type: 'null' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 enforce_schema: type: boolean default: false title: Enforce Schema required: - file - prompt_name - workspace title: Body_post_process_file_v2_v2_process_file__post VerifiedProcessingResponse: type: object description: Response model for verified file processing with multiple concurrent runs. properties: filename: type: string title: Filename runs: type: array items: $ref: '#/components/schemas/VerifiedProcessingRun' title: Runs summary: $ref: '#/components/schemas/VerifiedProcessingSummary' required: - filename - runs - summary title: VerifiedProcessingResponse Body_post_process_file_base64_v3_v3_workspaces__workspace_id__process_file_base64_post: type: object properties: file_content: type: string description: Base64 encoded file content (PDF, DOCX, TXT, etc.) title: File Content filename: type: string description: Original filename with extension example: invoice.pdf title: Filename prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. Use /workspaces/{workspace_id}/prompts to list available prompts. example: title: Prompt Id prompt_kwargs: anyOf: - type: string - type: 'null' description: 'Optional JSON string containing variables for prompt template substitution (e.g., ''{"company": "Acme Corp", "year": "2024"}''). Leave empty if not using template variables.' example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use for extraction. Options: flash_25_lite (fast), flash_25 (more accurate), pro_25. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce the output schema. When true, the API will validate extracted data against the schema. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema to enforce on the extraction output. When provided, the API will validate extracted data against this schema. This takes precedence over any schema attached to the prompt version. Must be a valid JSON Schema (Draft 2020-12). Leave empty to use the prompt version's schema (if enforce_schema is true) or no schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names to enable for this extraction (e.g., ['calculator', 'web_search']). Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific version ID of the prompt to use. Leave empty to automatically use the latest version or version matching the tag. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select a specific prompt version (e.g., 'production', 'staging'). Leave empty to use the latest version. example: '' title: Tag max_retries: type: integer default: 1 description: 'Maximum number of retry attempts if extraction fails (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file_content - filename - prompt_id title: Body_post_process_file_base64_v3_v3_workspaces__workspace_id__process_file_base64_post Body_post_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_base64_post: type: object properties: file_content: type: string description: Base64 encoded file content title: File Content filename: type: string description: Original filename with extension example: document.pdf title: Filename prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. example: title: Prompt Id prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce output schema validation. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific prompt version ID. Leave empty for latest. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select prompt version. Leave empty for latest. example: '' title: Tag max_retries: type: integer default: 1 description: 'Max retry attempts (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries convert_pdf_to_images: type: boolean default: false description: 'Convert PDF pages to PNG images for LLM processing. Default: false.' example: false title: Convert Pdf To Images required: - file_content - filename - prompt_id title: Body_post_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_base64_post Body_post_process_file_verified_base64_v3_v3_workspaces__workspace_id__process_file_verified_base64_post: type: object properties: file_content: type: string description: Base64 encoded file content (PDF, DOCX, TXT, etc.) title: File Content filename: type: string description: Original filename with extension example: invoice.pdf title: Filename prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. Use /workspaces/{workspace_id}/prompts to list available prompts. example: title: Prompt Id num_runs: type: integer description: Number of parallel runs for verification (1-5) example: 1 maximum: 5 minimum: 1 title: Num Runs prompt_kwargs: anyOf: - type: string - type: 'null' description: 'Optional JSON string containing variables for prompt template substitution (e.g., ''{"company": "Acme Corp", "year": "2024"}''). Leave empty if not using template variables.' example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use for extraction. Options: flash_25_lite (fast), flash_25 (more accurate), pro_25. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce the output schema. When true, the API will validate extracted data against the schema. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema to enforce on the extraction output. When provided, the API will validate extracted data against this schema. This takes precedence over any schema attached to the prompt version. Must be a valid JSON Schema (Draft 2020-12). Leave empty to use the prompt version's schema (if enforce_schema is true) or no schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names to enable for this extraction (e.g., ['calculator', 'web_search']). Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific version ID of the prompt to use. Leave empty to automatically use the latest version or version matching the tag. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select a specific prompt version (e.g., 'production', 'staging'). Leave empty to use the latest version. example: '' title: Tag max_retries: type: integer default: 1 description: 'Maximum number of retry attempts if extraction fails (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file_content - filename - num_runs - prompt_id title: Body_post_process_file_verified_base64_v3_v3_workspaces__workspace_id__process_file_verified_base64_post VerifiedProcessingRun: type: object description: Individual run result in verified processing. properties: run_id: type: integer title: Run Id result: $ref: '#/components/schemas/ExtractFileResponse' processing_time: type: number title: Processing Time error: anyOf: - type: string - type: 'null' title: Error required: - processing_time - result - run_id title: VerifiedProcessingRun Body_post_process_file_with_prompt_v3_v3_workspaces__workspace_id__process_file_with_prompt_post: type: object properties: file: type: string format: binary description: The document file to process (PDF, DOCX, TXT, etc.) title: File prompt: type: string description: The prompt text to use for extraction. Provide the full prompt instruction here instead of using a saved prompt ID. example: Extract all invoice data from the document... title: Prompt prompt_kwargs: anyOf: - type: string - type: 'null' description: 'Optional JSON string containing variables for prompt template substitution (e.g., ''{"company": "Acme Corp", "year": "2024"}''). Leave empty if not using template variables.' example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use for extraction. Default: flash_25.' example: flash_25 output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema to enforce on the extraction output. When provided, the API will validate extracted data against this schema. This takes precedence over any schema attached to the prompt version. Must be a valid JSON Schema (Draft 2020-12). Leave empty to use the prompt version's schema (if enforce_schema is true) or no schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names to enable for this extraction. Leave empty to use default tools. example: [] title: Tools convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file - prompt title: Body_post_process_file_with_prompt_v3_v3_workspaces__workspace_id__process_file_with_prompt_post Body_post_process_file_async_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_post: type: object properties: file: type: string format: binary description: Document file to process asynchronously title: File prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. example: title: Prompt Id prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce output schema validation. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific prompt version ID. Leave empty for latest. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select prompt version. Leave empty for latest. example: '' title: Tag max_retries: type: integer default: 1 description: 'Max retry attempts (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries enable_mep_output: type: boolean default: false description: 'Enable MEP connector notification. Default: false.' example: false title: Enable Mep Output convert_pdf_to_images: type: boolean default: false description: 'Convert PDF pages to PNG images for LLM processing. Default: false.' example: false title: Convert Pdf To Images required: - file - prompt_id title: Body_post_process_file_async_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_post ExtractAsyncResponse: type: object properties: tracking_id: type: string format: uuid title: Tracking Id status: type: string title: Status required: - status - tracking_id title: ExtractAsyncResponse ? Body_post_process_file_with_prompt_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_base64_post : type: object properties: file_content: type: string description: Base64 encoded file content title: File Content filename: type: string description: Original filename with extension example: document.pdf title: Filename prompt: type: string description: Prompt text for extraction example: Extract all invoice data from the document... title: Prompt prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools convert_pdf_to_images: type: boolean default: false description: 'Convert PDF pages to PNG images for LLM processing. Default: false.' example: false title: Convert Pdf To Images required: - file_content - filename - prompt title: Body_post_process_file_with_prompt_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_base64_post ModelType: type: string enum: - flash_25_lite - flash_25_low - flash_25 - flash_3 - flash_35 - pro_25 - pro_31 - claude_haiku_45 - claude_sonnet_46 - claude_sonnet_46_low - claude_opus_46 - claude_opus_46_low - nova_2_lite - nova_2_pro_preview - nova_2_pro_preview_low title: ModelType Body_post_process_file_with_prompt_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_post: type: object properties: file: type: string format: binary description: The document file to process (PDF, DOCX, TXT, etc.) title: File prompt: type: string description: Prompt text for extraction example: Extract all invoice data from the document... title: Prompt prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file - prompt title: Body_post_process_file_with_prompt_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_with_prompt_post Body_post_async_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_base64_post: type: object properties: file_content: type: string description: Base64 encoded file content title: File Content filename: type: string description: Original filename with extension example: document.pdf title: Filename prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. example: title: Prompt Id prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce output schema validation. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific prompt version ID. Leave empty for latest. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select prompt version. Leave empty for latest. example: '' title: Tag max_retries: type: integer default: 1 description: 'Max retry attempts (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries enable_mep_output: type: boolean default: false description: 'Enable MEP connector notification. Default: false.' example: false title: Enable Mep Output convert_pdf_to_images: type: boolean default: false description: 'Convert PDF pages to PNG images for LLM processing. Default: false.' example: false title: Convert Pdf To Images required: - file_content - filename - prompt_id title: Body_post_async_process_file_base64_v3_api_key_v3_api_key_auth_workspaces__workspace_id__async_process_file_base64_post FileMetadata: type: object properties: uuid: anyOf: - type: string - type: 'null' title: Uuid request_id: anyOf: - type: string - type: 'null' title: Request Id model_type: $ref: '#/components/schemas/ModelType' input_tokens: type: integer title: Input Tokens output_tokens: type: integer title: Output Tokens thinking_tokens: anyOf: - type: integer - type: 'null' title: Thinking Tokens token_costs: type: number title: Token Costs processed_at: type: string title: Processed At finish_reason: anyOf: - type: string - type: 'null' title: Finish Reason finish_message: anyOf: - type: string - type: 'null' title: Finish Message tool_calls: type: array default: [] items: type: string title: Tool Calls processing_time_ms: anyOf: - type: integer - type: 'null' title: Processing Time Ms required: - input_tokens - model_type - output_tokens - processed_at - token_costs title: FileMetadata Body_post_process_file_async_v2_v2_async_process_file__post: type: object properties: workspace: type: string title: Workspace file: type: string format: binary title: File prompt_name: type: string title: Prompt Name prompt_kwargs: anyOf: - type: string - type: 'null' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 enforce_schema: type: boolean default: false title: Enforce Schema required: - file - prompt_name - workspace title: Body_post_process_file_async_v2_v2_async_process_file__post Body_post_process_file_verified_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_verified_post: type: object properties: file: type: string format: binary description: Document file for verified processing title: File prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. example: title: Prompt Id num_runs: type: integer description: Number of parallel runs for verification (1-5) example: 1 maximum: 5 minimum: 1 title: Num Runs prompt_kwargs: anyOf: - type: string - type: 'null' description: Optional JSON string with template variables. Leave empty if not using template variables. example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce output schema validation. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema for output validation. Overrides prompt schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names. Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific prompt version ID. Leave empty for latest. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select prompt version. Leave empty for latest. example: '' title: Tag max_retries: type: integer default: 1 description: 'Max retry attempts (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries convert_pdf_to_images: type: boolean default: false description: 'Convert PDF pages to PNG images for LLM processing. Default: false.' example: false title: Convert Pdf To Images required: - file - num_runs - prompt_id title: Body_post_process_file_verified_v3_api_key_v3_api_key_auth_workspaces__workspace_id__process_file_verified_post Body_post_process_file_v3_v3_workspaces__workspace_id__process_file_post: type: object properties: file: type: string format: binary description: The document file to process (PDF, DOCX, TXT, etc.) title: File prompt_id: type: string format: uuid description: The ID of the prompt to use for extraction. Use /workspaces/{workspace_id}/prompts to list available prompts. example: title: Prompt Id prompt_kwargs: anyOf: - type: string - type: 'null' description: 'Optional JSON string containing variables for prompt template substitution (e.g., ''{"company": "Acme Corp", "year": "2024"}''). Leave empty if not using template variables.' example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use for extraction. Options: flash_25_lite (fast), flash_25 (more accurate), pro_25. Default: flash_25.' example: flash_25 enforce_schema: type: boolean default: false description: 'Whether to strictly enforce the output schema. When true, the API will validate extracted data against the schema. Default: false.' example: false title: Enforce Schema output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema to enforce on the extraction output. When provided, the API will validate extracted data against this schema. This takes precedence over any schema attached to the prompt version. Must be a valid JSON Schema (Draft 2020-12). Leave empty to use the prompt version's schema (if enforce_schema is true) or no schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names to enable for this extraction (e.g., ['calculator', 'web_search']). Leave empty if no tools should be used/available. example: [] title: Tools prompt_version_id: anyOf: - type: string - type: 'null' description: Optional specific version ID of the prompt to use. Leave empty to automatically use the latest version or version matching the tag. example: '' title: Prompt Version Id tag: anyOf: - type: string - type: 'null' description: Optional tag to select a specific prompt version (e.g., 'production', 'staging'). Leave empty to use the latest version. example: '' title: Tag max_retries: type: integer default: 1 description: 'Maximum number of retry attempts if extraction fails (0-2). Default: 1.' example: 1 maximum: 2 minimum: 0 title: Max Retries convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file - prompt_id title: Body_post_process_file_v3_v3_workspaces__workspace_id__process_file_post ExtractFileResponse: type: object properties: filename: anyOf: - type: string - type: 'null' title: Filename data: anyOf: - type: array items: {} - type: object additionalProperties: true - type: string - type: 'null' title: Data metadata: anyOf: - $ref: '#/components/schemas/FileMetadata' - type: 'null' error: anyOf: - type: string - type: 'null' title: Error title: ExtractFileResponse Body_post_process_file_with_prompt_base64_v3_v3_workspaces__workspace_id__process_file_with_prompt_base64_post: type: object properties: file_content: type: string description: Base64 encoded file content (PDF, DOCX, TXT, etc.) title: File Content filename: type: string description: Original filename with extension example: invoice.pdf title: Filename prompt: type: string description: The prompt text to use for extraction. Provide the full prompt instruction here instead of using a saved prompt ID. example: Extract all invoice data from the document... title: Prompt prompt_kwargs: anyOf: - type: string - type: 'null' description: 'Optional JSON string containing variables for prompt template substitution (e.g., ''{"company": "Acme Corp", "year": "2024"}''). Leave empty if not using template variables.' example: '' title: Prompt Kwargs model_type: $ref: '#/components/schemas/ModelType' default: flash_25 description: 'The AI model to use for extraction. Options: flash_25_lite (fast), flash_25 (more accurate), pro_25. Default: flash_25.' example: flash_25 output_schema: anyOf: - type: string - type: 'null' description: Optional JSON Schema to enforce on the extraction output. When provided, the API will validate extracted data against this schema. This takes precedence over any schema attached to the prompt version. Must be a valid JSON Schema (Draft 2020-12). Leave empty to use the prompt version's schema (if enforce_schema is true) or no schema. example: '{"type": "object", "properties": {"field1": {"type": "string"}}}' title: Output Schema tools: anyOf: - type: array items: type: string - type: 'null' description: Optional list of tool names to enable for this extraction (e.g., ['calculator', 'web_search']). Leave empty if no tools should be used/available. example: [] title: Tools convert_pdf_to_images: type: boolean default: false description: 'If true and the file is a PDF, convert each page to PNG images before LLM processing. This forces the LLM to use OCR capabilities for the entire page content, which can improve extraction quality for PDFs with incomplete or unreliable text layers. Default: false.' example: false title: Convert Pdf To Images required: - file_content - filename - prompt title: Body_post_process_file_with_prompt_base64_v3_v3_workspaces__workspace_id__process_file_with_prompt_base64_post ValidationError: type: object properties: loc: type: array items: anyOf: - type: string - type: integer title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context required: - loc - msg - type title: ValidationError securitySchemes: default: type: oauth2 flows: implicit: authorizationUrl: https://gateway.api.kuehne-nagel.com/authorize scopes: {} x-wso2-api-key-header: ApiKey