Skip to main content
POST
https://api.clevrscan.com
/
api
/
templates
curl -X POST "https://api.clevrscan.com/api/templates" \
  -H "X-API-Key: <api_key>" \
  -F "file=@invoice.pdf" \
  -F "name=General" \
  -F "description=Invoice" \
  -F "extractFields=[\"Company Name\",\"Company Address\",\"Bill To\",\"Ship To\",\"Invoice Number\",\"Invoice Date\",\"P.O. Number\",\"Due Date\",\"Invoice Total\",\"Quantity\",\"Description\",\"Unit Price\",\"Amount\",\"Subtotal\",\"GST\",\"Terms & Conditions\",\"Payment Due Date\",\"Bank Name\",\"Account Number\",\"Routing Number\"]" \
  -F "instructions="
{
  "message": "Template created successfully",
  "template_id": 396
}

Request Format

Option 1:Multipart Form Data
POST /api/templates
Content-Type: multipart/form-data
X-API-Key: <api_key>

file: <binary file>
name: <template name>
description: <template description>
extractFields: ["field1", "field2", ...]
instructions: <optional custom instructions>

Parameters

ParameterTypeRequiredLocationDescription
fileFileYesBodyDocument file (sample PDF/image) used to define the template
nameStringYesBodyTemplate name (e.g., "General")
descriptionStringYesBodyShort description of the template (e.g., "Invoice")
extractFieldsString[]YesBodyList of fields to extract (e.g., company name, invoice total, due date, …)
instructionsStringNoBodyAdditional processing instructions (custom rules or extraction logic)
api_keyStringYesHeaderAPI key
extractFields must be passed as a JSON array string.
curl -X POST "https://api.clevrscan.com/api/templates" \
  -H "X-API-Key: <api_key>" \
  -F "file=@invoice.pdf" \
  -F "name=General" \
  -F "description=Invoice" \
  -F "extractFields=[\"Company Name\",\"Company Address\",\"Bill To\",\"Ship To\",\"Invoice Number\",\"Invoice Date\",\"P.O. Number\",\"Due Date\",\"Invoice Total\",\"Quantity\",\"Description\",\"Unit Price\",\"Amount\",\"Subtotal\",\"GST\",\"Terms & Conditions\",\"Payment Due Date\",\"Bank Name\",\"Account Number\",\"Routing Number\"]" \
  -F "instructions="
{
  "message": "Template created successfully",
  "template_id": 396
}