Skip to content
Framework Docs

Validate Extraction Schema

POST/api/v2/extract/schema/validation

Validate a JSON schema for extraction.

Cookie ParametersExpand Collapse
session: optional string
Body ParametersJSONExpand Collapse
data_schema: map[map[unknown] or array of unknown or string or 2 more]

JSON Schema to validate for use with extract jobs

One of the following:
map[unknown]
array of unknown
string
number
boolean
ReturnsExpand Collapse
ExtractV2SchemaValidateResponse object { data_schema }

Response schema for schema validation.

data_schema: map[map[unknown] or array of unknown or string or 2 more]

Validated JSON Schema, ready for use in extract jobs

One of the following:
map[unknown]
array of unknown
string
number
boolean

Validate Extraction Schema

curl https://api.cloud.llamaindex.ai/api/v2/extract/schema/validation \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '{
          "data_schema": {
            "properties": {
              "vendor_name": "bar",
              "invoice_number": "bar",
              "total_amount": "bar",
              "line_items": "bar"
            },
            "required": [
              "vendor_name",
              "invoice_number",
              "total_amount"
            ],
            "type": "object"
          }
        }'
{
  "data_schema": {
    "foo": {
      "foo": "bar"
    }
  }
}
Returns Examples
{
  "data_schema": {
    "foo": {
      "foo": "bar"
    }
  }
}