Logo ExelensiaExelensia/Docs
Getting Started
  • Introduction
API Reference
  • Schemas
  • Templates
  • Upload
  • Process
  • Files
  • Results
  • Exports

Templates

Templates are pre-built extraction schemas provided by the Exelensia platform. Unlike user-created schemas, templates are read-only — you cannot create, update, or delete them. Use templates as a starting point or apply them directly when submitting documents for processing.

Endpoints

GET /v1/templates

Returns a paginated list of all available extraction templates.

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number (min: 1)
limitnumberNo20Items per page (min: 1, max: 100)
sort_bystringNo—Field to sort by (e.g. name)
sort_orderstringNodescSort direction: asc or desc
searchstringNo—Filter by template name
created_afterstringNo—ISO 8601 date — return templates created after this date
created_beforestringNo—ISO 8601 date — return templates created before this date
fieldsstringNo—Comma-separated list of fields to return
includestringNo—Related resources to include

Request

Bash
curl -H "x-api-key: your_api_key_here" \
  "https://api.exelensia.com/v1/templates?page=1&limit=20"

Response

JSON
{
  "data": [
    {
      "id": "019760a0-0010-7000-8000-000000000010",
      "name": "Standard Invoice",
      "description": "Extract common invoice fields: number, date, vendor, total, and line items",
      "schema": {
        "fields": [
          { "key": "invoice_number", "type": "string", "label": "Invoice Number" },
          { "key": "invoice_date", "type": "date", "label": "Invoice Date" },
          { "key": "due_date", "type": "date", "label": "Due Date" },
          { "key": "vendor_name", "type": "string", "label": "Vendor Name" },
          { "key": "vendor_address", "type": "string", "label": "Vendor Address" },
          { "key": "subtotal", "type": "number", "label": "Subtotal" },
          { "key": "tax", "type": "number", "label": "Tax Amount" },
          { "key": "total", "type": "number", "label": "Total Amount" }
        ]
      },
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z"
    },
    {
      "id": "019760a0-0011-7000-8000-000000000011",
      "name": "Purchase Order",
      "description": "Extract PO number, supplier details, line items, and total",
      "schema": {
        "fields": [
          { "key": "po_number", "type": "string", "label": "PO Number" },
          { "key": "po_date", "type": "date", "label": "PO Date" },
          { "key": "supplier_name", "type": "string", "label": "Supplier Name" },
          { "key": "delivery_date", "type": "date", "label": "Delivery Date" },
          { "key": "total_amount", "type": "number", "label": "Total Amount" }
        ]
      },
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 2,
    "totalPages": 1
  }
}

Status Codes

StatusDescription
200Success
401Missing or invalid authentication

GET /v1/templates/:id

Returns a single template by ID.

Path Parameters

ParameterTypeRequiredDescription
idstringYesTemplate UUID

Request

Bash
curl -H "x-api-key: your_api_key_here" \
  "https://api.exelensia.com/v1/templates/019760a0-0010-7000-8000-000000000010"

Response

JSON
{
  "id": "019760a0-0010-7000-8000-000000000010",
  "name": "Standard Invoice",
  "description": "Extract common invoice fields: number, date, vendor, total, and line items",
  "schema": {
    "fields": [
      { "key": "invoice_number", "type": "string", "label": "Invoice Number" },
      { "key": "invoice_date", "type": "date", "label": "Invoice Date" },
      { "key": "due_date", "type": "date", "label": "Due Date" },
      { "key": "vendor_name", "type": "string", "label": "Vendor Name" },
      { "key": "vendor_address", "type": "string", "label": "Vendor Address" },
      { "key": "subtotal", "type": "number", "label": "Subtotal" },
      { "key": "tax", "type": "number", "label": "Tax Amount" },
      { "key": "total", "type": "number", "label": "Total Amount" }
    ]
  },
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-01T00:00:00.000Z"
}

Status Codes

StatusDescription
200Success
401Missing or invalid authentication
404Template not found

On this page

  • Endpoints
  • GET /v1/templates
  • GET /v1/templates/:id