Run Extract

POST /extract

Run extract based on the passed in request parameters

This is an asynchronous API endpoint. The initial request returns a jobId and status. You can use the jobId to check the processing status and fetch results.

Request

Headers

An API Key is required to access this endpoint.

Name
Value

x-api-key

your_api_key

Params

Either file or URL is required but not both. See Accepted File Types.

Name

Type

Description

file

file

File used for extraction

url

string

URL of the document used for extraction

schema

JSON (optional)

JSON schema

excludeOCRResult

boolean

Excludes OCR result from the response. Defaults to false

maintainFormat

boolean

Maintains format from the previous page. Defaults to false

extractPerPage

boolean

Runs the extraction on each page and returns an array of results. Good for applications with lots of repeated content. Defaults to false

webhookId

string (optional)

Unique ID for the webhook

Example JSON Schema

This is a JSON Schema, which defines the structure and validation rules for the JSON. For more examples and details, see JSON Schema Examples.

{
    "type": "object",
    "properties": {
        "bill_to": {
            "type": "string",
            "description": "The name of person who receives the invoice"
        },
        "ship_to": {
            "type": "string",
            "description": "The location of the person who receives the invoice"
        },
        "balance_due": {
            "type": "number",
            "description": "The total balance due"
        }
    }
}

Response

The API returns the response in JSON format.

The request will return a 200 with a jobId and status. You can use this jobId to check the processing status and fetch results.

Example

{
  "jobId": "a9b5c4f0-8202-4375-8e2c-4383a5b0d450",
  "result": "https://api.getomni.ai/extract?jobId=a9b5c4f0-8202-4375-8e2c-4383a5b0d450",
  "status": "PENDING"
}

Last updated