Skip to content

Endpoint Reference

Use the extraction API to submit documents and retrieve structured results. Create your templates and filters in the app, then select them by name in your requests.

Send requests to https://api.terrafai.com with your environment’s API key:

Authorization: api-key <environment-api-key>

See Authentication & Errors to create a key. The key determines which environment’s templates, filters, and jobs you can use.

Method and pathWhat it does
POST /api/v1/extractFieldsExtracts a file and returns the result in the same request. See Synchronous Extraction.
POST /api/v1/extraction-jobsCreates a job and returns its ID. Use this when your backend needs to retrieve results later or receive a webhook. See Asynchronous Extraction.
GET /api/v1/extraction-jobs/:idReturns the job’s status.
GET /api/v1/extraction-jobs/:id/resultReturns the completed extraction result.

Both upload endpoints accept an optional X-Client-Reference header to connect requests to records in your system. Async job creation also accepts an Idempotency-Key for safe retries.

Manage templates, filters, workflows, webhook endpoints, document review, API keys, and usage in the app. Start with Templates, Filters & Workflows to prepare your extraction setup.