POST
/
api
/
v1
/
schemas
curl --request POST \
  --url https://api.invaro.ai/api/v1/api/v1/schemas \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "invoice_schema_v1",
  "type": "invoice",
  "description": "Schema for parsing standard invoices",
  "schema_string": {
    "fields": [
      "invoice_number",
      "date",
      "total"
    ]
  }
}'
{
  "success": true,
  "data": {
    "id": "b3376c85-86e0-476e-aee9-5f05afaa05ea",
    "user_id": "b4825725-605b-4374-a64e-c40896b5a0e8",
    "name": "invoice_schema_v1",
    "type": "invoice",
    "description": "Schema for parsing standard invoices",
    "schema_string": "{\"fields\": [...]} Gzip Base64 format",
    "version": 1,
    "is_active": true,
    "created_at": "2024-01-18T12:34:56Z",
    "updated_at": "2024-01-18T12:34:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name for the schema (unique per user)

Example:

"invoice_schema_v1"

type
enum<string>
required

Type of document the schema is for

Available options:
invoice,
bank_statement
Example:

"invoice"

schema_string
object
required

The schema definition itself

description
string

Optional description for the schema

Example:

"Schema for parsing standard invoices"

Response

200 - application/json
Schema created successfully
success
boolean
Example:

true

data
object