Affinda’s Document AI API turns any incoming document — from invoices and résumés to passports and bills of lading — into clean, structured JSON you can drop straight into your workflow. Behind the scenes our models have already processed more than 250 million documents for 500 + organisations in 40 countries; the API is the thin, dependable interface that lets your own code tap that capability.
To understand how to implement Affinda into your existing tutorials, our Solution Design Tutorial walks through the range of common integration workflows for different use cases and requirements.

Design principles

  • Few moving parts: A small set of REST resources (/documents, /document_types, /workspaces) covers the vast majority of use-cases.
  • Works straight away, yet customisable: Upload a PDF and retrieve JSON in a single call, or fine-tune behaviour with model versions, human-in-the-loop validation and post-processing rules.
  • Document-agnostic by design: The same endpoint handles an invoice today and a payslip tomorrow; just swap the document type ID, not your integration.
  • Observability built-in: Every response carries processing timestamps and confidence scores; webhook signatures let you verify payloads.
  • Secure at scale: ISO-27001 compliant, API keys scoped per user, with regional endpoints to keep data where you need it.

Core primitives

PrimitivePurpose
DocumentThe file you upload (PDF, image, DOCX, etc.) plus its extracted data and metadata.
Document TypeA model configuration that defines how a specific kind of document (invoice, résumé, passport, custom layout, …) is parsed.
WorkspaceLogical container that groups documents, permissions and webhook settings.
With just these three concepts, you can automate the extraction of structured data from any document type.

Prerequisites

Before you make your first API call, you’ll need to:
  1. Create an Affinda account and log in to the dashboard.
  2. Generate an API key (SettingsAPI Keys).
  3. Configure a document type (See our step-by-step tutorial on Creating a New Model).
  4. Retrieve the workspace identifier (WorkspaceWorkflowIntegrations).

Parse your first document

# 1. Set your API key (found in the Affinda dashboard)
export AFFINDA_API_KEY="aff_562..."

# 2. Upload a document and wait for processing to finish
curl -X POST https://api.affinda.com/v3/documents \
     -H "Authorization: Bearer $AFFINDA_API_KEY" \
     -F "file=@sample_invoice.pdf" \
     -F "workspace=YOUR_WORKSPACE_IDENTIFIER"