Creating a Custom Schema

While Invaro’s general processing endpoints work well for standard documents, you can create custom schemas to precisely define the fields you want to extract, especially for unique document layouts.

Schemas tell the AI exactly what pieces of information to look for.

Create Schema Endpoint

Here’s a basic example using curl to create a simple schema for invoices:

cURL
curl -X POST "https://api.invaro.ai/api/v1/schemas" \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my_custom_invoice_schema_v1",
    "type": "invoice",
    "description": "Schema for extracting key fields from our specific supplier invoices",
    "schema_string": {
      "fields": [
        "invoice_number",
        "invoice_date",
        "total_amount_due",
        "supplier_name",
        "supplier_vat_id"
      ]
    }
  }'

Key Parameters:

  • name: A unique name for your schema.
  • type: Must be "invoice" or "bank_statement".
  • schema_string.fields: An array of strings listing the fields you want to extract.

This is a simplified overview. For detailed information on all request parameters and response formats, please see the Create Schema API Reference.

Using Schemas

Once created, schemas aren’t directly passed into the standard processing endpoints in this version. The system intelligently uses relevant active schemas based on document type and content during processing. You manage schemas via the dedicated Schema Management endpoints.

Next Steps

Now that you understand the basics of uploading, processing, checking status, and optionally creating schemas, let’s look at some complete code examples.

Code Examples

See complete code examples putting it all together.