Getting started / Quickstart

Quickstart

Make your first extraction in under five minutes — create a key, define a template, and submit a document.

1. Get an API key

In the dashboard, open API Keys → Create key. Copy the secret — it is shown once. Use sk_test_… keys while developing and sk_live_… in production. Send it on every request as a bearer token.

2. Create a template

A template lists the fields you want back. You can build it in the dashboard, or via the API:

cURL · POST /v1/templates
curl https://api.docmind.wistfare.com/v1/templates \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Commercial Invoice",
    "category": "Invoice",
    "prompt": "Extract the header fields and line items from the invoice.",
    "fields": [
      { "name": "invoice_number", "type": "string", "required": true },
      { "name": "total_amount", "type": "number" },
      { "name": "issue_date", "type": "date" },
      { "name": "line_items", "type": "array", "columns": ["description", "amount"] }
    ]
  }'

3. Run an extraction

Submit the template id and a document — a public file_url, or a base64 file data URL. An optional idempotency_key makes retries safe.

cURL · POST /v1/extract
curl https://api.docmind.wistfare.com/v1/extract \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "9f2a3c91-7d94-4401-94fe-cfbd6fed63f9",
    "file_url": "https://example.com/invoice.pdf",
    "idempotency_key": "order-4821"
  }'
202 Accepted
HTTP/1.1 202 Accepted

{
  "id": "2f14eb10-6b1d-4f0e-9a3b-1c7e6d5a8b21",
  "status": "queued",
  "template_id": "9f2a3c91-7d94-4401-94fe-cfbd6fed63f9"
}

4. Read the result

Poll the extraction until its status is completed (or register a webhook to be notified):

cURL · GET /v1/extractions/:id
curl https://api.docmind.wistfare.com/v1/extractions/2f14eb10-6b1d-4f0e-9a3b-1c7e6d5a8b21 \
  -H "Authorization: Bearer sk_live_..."

{
  "id": "2f14eb10-6b1d-4f0e-9a3b-1c7e6d5a8b21",
  "status": "completed",
  "fields": {
    "schema": "docmind.compact_extraction.v1",
    "values": {
      "invoice_number": "INV-2026-0481",
      "total_amount": 19872.0,
      "issue_date": "2026-05-21"
    },
    "sections": [
      {
        "name": "invoice_details",
        "title": "Invoice details",
        "fields": [
          {
            "name": "invoice_number",
            "title": "Invoice No",
            "type": "string",
            "value": "INV-2026-0481",
            "confidence": 0.96,
            "bounding_box": { "page": 1, "x": 427, "y": 305, "width": 160, "height": 22 }
          }
        ]
      }
    ]
  },
  "latency_ms": 2410
}
TipAdd credit under Billing → Top up before going live — extractions debit your balance at your organization’s current customer rate. New organizations include a small starter balance for testing.