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

Process

The Process API submits an uploaded file for extraction. Processing is asynchronous — creating a job returns immediately with status queued, and extraction runs in the background. Poll this endpoint to watch the job's status, then fetch the data from the Results API.

If your account has auto-processing enabled (the default), uploading a file already queues a job for you — you only need this endpoint to (re)process a file manually.

Job Status Values

StatusDescription
queuedJob created, waiting to start
processingExtraction in progress
completedExtraction finished — results available
failedExtraction failed — see error_code

Error Codes

When a job fails, error_code holds one of the following (otherwise it is null):

CodeMeaning
FILE_EXPIREDThe uploaded file is no longer available; upload it again
FILE_NOT_FOUNDThe file could not be found
INSUFFICIENT_CREDITSNot enough credits to process the file
SCHEMA_NOT_FOUNDThe selected schema is no longer available
SERVICE_UNAVAILABLEProcessing is temporarily unavailable; try again shortly
UNREADABLE_DOCUMENTThe document could not be read (damaged or unsupported)
RESULTS_SAVE_FAILEDThe results could not be saved; try again
PROCESSING_FAILEDSomething went wrong while processing the file

Endpoints

GET /v1/process

Returns a paginated list of process jobs for your team, ordered by creation date (newest first).

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number (min: 1)
limitnumberNo20Items per page (min: 1, max: 25)
sort_orderstringNodescSort direction by creation date: asc or desc
created_afterstringNo—ISO 8601 date filter
created_beforestringNo—ISO 8601 date filter
file_idstringNo—Filter jobs by a specific file UUID

Request

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

Response

JSON
{
  "data": [
    {
      "id": "019760a0-0030-7000-8000-000000000030",
      "status": "completed",
      "message": "Processing queued",
      "error_code": null,
      "file": {
        "id": "019760a0-0020-7000-8000-000000000020",
        "filename": "invoice_2024_01.pdf"
      },
      "schema": {
        "id": "019760a0-0001-7000-8000-000000000001",
        "name": "Invoice Schema"
      }
    },
    {
      "id": "019760a0-0031-7000-8000-000000000031",
      "status": "queued",
      "message": "Processing queued",
      "error_code": null,
      "file": {
        "id": "019760a0-0021-7000-8000-000000000021",
        "filename": "contract_q1.docx"
      },
      "schema": null
    }
  ],
  "meta": {
    "total": 2,
    "page": 1,
    "limit": 20,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPrevPage": false
  }
}
FieldDescription
idProcess job UUID
statusOne of the job status values
messageHuman-readable status message
error_codeMachine-readable failure code, or null
fileThe processed file, as { id, filename }
schemaThe schema applied, as { id, name }, or null if none

Status Codes

StatusDescription
200Success
401Missing or invalid authentication

POST /v1/process

Creates an extraction job for a file. Returns immediately — extraction runs asynchronously.

Request Body

FieldTypeRequiredDescription
file_idstringYesUUID of the uploaded file (from the Upload API)
schema_idstringNoUUID of the schema (or template) to apply
Bash
curl -X POST \
  -H "x-api-key: wk_xxxxxxxx.your_secret_here" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "019760a0-0020-7000-8000-000000000020",
    "schema_id": "019760a0-0001-7000-8000-000000000001"
  }' \
  "https://api.exelensia.com/v1/process"

Response

JSON
{
  "id": "019760a0-0030-7000-8000-000000000030",
  "status": "queued",
  "message": "Processing queued",
  "error_code": null,
  "file": {
    "id": "019760a0-0020-7000-8000-000000000020",
    "filename": "invoice_2024_01.pdf"
  },
  "schema": {
    "id": "019760a0-0001-7000-8000-000000000001",
    "name": "Invoice Schema"
  }
}

After submitting, poll GET /v1/process (or GET /v1/results) to know when extraction completes, then fetch the data from the Results API.

Status Codes

StatusDescription
201Process job created
400Invalid request body, or the file/schema does not belong to your team
401Missing or invalid authentication

On this page

  • Job Status Values
  • Error Codes
  • Endpoints
  • GET /v1/process
  • POST /v1/process