Schemas define the structure of data you want to extract from your documents. Each schema contains a set of field definitions that tell the extraction engine what to look for. Once created, a schema can be reused across multiple documents.
Returns a paginated list of extraction schemas belonging to your team.
Parameter Type Required Default Description pagenumber No 1 Page number (min: 1) limitnumber No 20 Items per page (min: 1, max: 100) sort_bystring No — Field to sort by (e.g. createdAt) sort_orderstring No descSort direction: asc or desc searchstring No — Filter by schema name created_afterstring No — ISO 8601 date — return schemas created after this date created_beforestring No — ISO 8601 date — return schemas created before this date fieldsstring No — Comma-separated list of fields to return includestring No — Related resources to include
curl -H "x-api-key: your_api_key_here" \
"https://api.exelensia.com/v1/schemas?page=1&limit=20"
{
"data" : [
{
"id" : "019760a0-0001-7000-8000-000000000001" ,
"name" : "Invoice Schema" ,
"description" : "Extract invoice number, date, total, and line items" ,
"schema" : {
"fields" : [
{ "key" : "invoice_number" , "type" : "string" , "label" : "Invoice Number" },
{ "key" : "date" , "type" : "date" , "label" : "Invoice Date" },
{ "key" : "total" , "type" : "number" , "label" : "Total Amount" },
{ "key" : "vendor_name" , "type" : "string" , "label" : "Vendor Name" }
]
},
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"updatedAt" : "2024-01-15T10:30:00.000Z"
}
],
"meta" : {
"page" : 1 ,
"limit" : 20 ,
"total" : 1 ,
"totalPages" : 1
}
}
Status Description 200Success 401Missing or invalid authentication
Returns a single schema by ID.
Parameter Type Required Description idstring Yes Schema UUID
curl -H "x-api-key: your_api_key_here" \
"https://api.exelensia.com/v1/schemas/019760a0-0001-7000-8000-000000000001"
{
"id" : "019760a0-0001-7000-8000-000000000001" ,
"name" : "Invoice Schema" ,
"description" : "Extract invoice number, date, total, and line items" ,
"schema" : {
"fields" : [
{ "key" : "invoice_number" , "type" : "string" , "label" : "Invoice Number" },
{ "key" : "date" , "type" : "date" , "label" : "Invoice Date" },
{ "key" : "total" , "type" : "number" , "label" : "Total Amount" },
{ "key" : "vendor_name" , "type" : "string" , "label" : "Vendor Name" }
]
},
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"updatedAt" : "2024-01-15T10:30:00.000Z"
}
Status Description 200Success 401Missing or invalid authentication 404Schema not found
Creates a new extraction schema.
Field Type Required Description namestring Yes Human-readable schema name descriptionstring No Optional description schemaobject Yes Schema definition object containing field definitions
curl -X POST \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Contract Schema",
"description": "Extract key contract fields",
"schema": {
"fields": [
{ "key": "party_a", "type": "string", "label": "First Party" },
{ "key": "party_b", "type": "string", "label": "Second Party" },
{ "key": "effective_date", "type": "date", "label": "Effective Date" },
{ "key": "value", "type": "number", "label": "Contract Value" }
]
}
}' \
"https://api.exelensia.com/v1/schemas"
{
"id" : "019760a0-0002-7000-8000-000000000002" ,
"name" : "Contract Schema" ,
"description" : "Extract key contract fields" ,
"schema" : {
"fields" : [
{ "key" : "party_a" , "type" : "string" , "label" : "First Party" },
{ "key" : "party_b" , "type" : "string" , "label" : "Second Party" },
{ "key" : "effective_date" , "type" : "date" , "label" : "Effective Date" },
{ "key" : "value" , "type" : "number" , "label" : "Contract Value" }
]
},
"createdAt" : "2024-01-16T08:00:00.000Z" ,
"updatedAt" : "2024-01-16T08:00:00.000Z"
}
Status Description 201Schema created 400Invalid request body 401Missing or invalid authentication
Deletes a schema by ID.
Parameter Type Required Description idstring Yes Schema UUID
curl -X DELETE \
-H "x-api-key: your_api_key_here" \
"https://api.exelensia.com/v1/schemas/019760a0-0001-7000-8000-000000000001"
{
"message" : "Schema deleted successfully"
}
Status Description 200Schema deleted 401Missing or invalid authentication 404Schema not found