canonical: https://jentic.com/apis/koncile.ai/koncile

# Koncile API

Jentic publishes the only available OpenAPI specification for Koncile API, keeping it validated and agent-ready. Koncile is a document data extraction service that converts invoices, receipts, and other business documents into structured fields using AI templates. The API exposes file upload, async task results, folders that group documents, templates and their fields and instructions, plus document and field-data retrieval. It suits finance, AP, and operations teams who want to script invoice ingestion or build a custom UI on top of Koncile's extraction engine.

## For AI agents

Upload business documents to Koncile, run template-based extraction, and pull structured field data through async tasks.

## Scope

Does not handle accounting ledger writes, payment execution, or document storage outside Koncile - use for uploading, extracting, and retrieving structured fields from documents only.

## Capabilities

- Upload an invoice or receipt file to a Koncile folder for extraction
- Poll for the result of an async extraction task
- Create or update an extraction template with custom fields
- Add fields and field instructions to refine extraction accuracy
- Fetch the structured field data extracted from a processed document
- Organise documents into folders for batch processing
- Validate an API key against the Koncile service

## Use cases

### Automated Invoice Ingestion for AP Teams

Replace manual invoice keying with a Koncile pipeline that uploads PDFs, runs template extraction, and writes fields into the accounts-payable system. POST `/v1/upload_file`/ accepts the document, `/v1/fetch_tasks_results`/ polls for completion, and `/v1/fetch_document_data`/ returns the structured fields. This is a common workflow for finance teams that receive hundreds of supplier invoices per month.

Example prompt: Upload supplier-invoice.pdf via POST `/v1/upload_file`/, poll `/v1/fetch_tasks_results`/ until status is complete, then return total_amount and supplier_name from `/v1/fetch_document_data/.`

### Custom Template Creation for New Document Types

Stand up extraction for a new document type - purchase orders, contracts, expense receipts - by scripting template creation. POST `/v1/create_template`/ defines the template, `/v1/create_field`/ adds fields, and `/v1/create_instruction`/ refines extraction logic. Useful when an operations team needs to onboard a new vendor's document format without going through the Koncile UI.

Example prompt: Create a template named 'shipping-bill', add fields 'tracking_number' and 'shipping_cost', then add an instruction telling Koncile that 'shipping_cost' appears under the 'Total Charges' label.

### Folder-Based Batch Processing

Group related documents into a folder so an automation can process them as a batch. `/v1/create_folder`/ creates the folder, uploads target it, and `/v1/fetch_documents`/ enumerates the contents for downstream steps. Suited for monthly closing cycles where a team drops dozens of receipts into one bucket and needs everything extracted before reconciliation.

Example prompt: Create a folder named 'may-receipts-2026' and list all documents in it via `/v1/fetch_documents/.`

### Field-Level Quality Loop

Improve extraction quality by inspecting and adjusting fields and instructions over time. `/v1/fetch_field`/ and `/v1/fetch_instruction`/ surface the current configuration, which an agent can review against actual extraction errors. This makes Koncile usable as a self-improving pipeline rather than a black box.

Example prompt: Fetch the instructions for template 'supplier-invoices' via `/v1/fetch_instruction`/ and report any fields that have no instruction defined.

### Agent-Driven Document Pipeline via Jentic

Have an AI agent run the full Koncile pipeline - upload, poll, fetch - when a finance teammate forwards an invoice email. The agent searches Jentic for the matching Koncile operation, loads the schema, and executes with the bearer token kept in your Jentic One instance. Removes glue code that would otherwise stitch together upload, polling, and field retrieval.

Example prompt: Through Jentic, search for 'extract data from a Koncile invoice', load `/v1/upload_file`/, upload invoice.pdf, poll for the result, and return the parsed fields.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/upload_file/` | Upload a document for extraction |
| POST | `/v1/fetch_tasks_results/` | Fetch the result of an async task |
| POST | `/v1/fetch_document_data/` | Retrieve extracted field data for a document |
| POST | `/v1/create_template/` | Create an extraction template |
| POST | `/v1/create_field/` | Add a field to a template |
| POST | `/v1/create_folder/` | Create a folder for grouping documents |
| POST | `/v1/fetch_documents/` | List documents inside a folder |
| POST | `/v1/check_api_key/` | Validate an API key |

## Key resources

- **API Key Check** — Validate that an API key is active
- **File Upload** — Upload a document for extraction
- **Tasks** — Poll for the result of an async extraction task
- **Folders** — Group documents into folders for batch processing
- **Templates** — Create and inspect extraction templates
- **Fields** — Define and inspect fields on a template
- **Instructions** — Add extraction instructions to refine accuracy
- **Documents** — Inspect uploaded documents and their parsed data

## Why Jentic

- **Setup:** Wiring Koncile by hand means implementing its bearer auth against api.koncile.ai and polling the async upload-then-fetch flow, uploading a file, then checking task results and pulling document data yourself. Through Jentic you install once, import the Koncile API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Koncile's document operations take their targets in the request body rather than the URL path, so scope the agent to the operations it needs, such as uploading a file and fetching document data. You choose that set, so a create-only operation like create_template or create_field is not included unless you add it.
- **Credential handling:** Your Koncile bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'extract invoice data' or 'create a Koncile template', and Jentic returns the matching Koncile operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Mindee API** — Document AI platform with prebuilt invoice and receipt parsers
- **Rossum API** — Cognitive document processing platform aimed at high-volume AP
- **Airtable API** — Common destination for the structured fields Koncile extracts

## FAQ

### Why is there no official OpenAPI spec for Koncile API?

Koncile does not publish a complete OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Koncile API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Koncile API use?

The Koncile API uses HTTP Bearer authentication. The bearer token is sent in the Authorization header on every request. Through Jentic, the token is held in your Jentic One instance and injected at execution time so the agent never sees the raw value. `/v1/check_api_key`/ can confirm a token is active.

### How does Koncile's async extraction work?

POST `/v1/upload_file`/ submits a document and returns a task id. The actual extraction runs asynchronously. Poll `/v1/fetch_tasks_results`/ with the task id until the status is complete, then call `/v1/fetch_document_data`/ to retrieve the structured fields.

### What are the rate limits for the Koncile API?

Koncile does not publish a public rate limit and the spec does not declare one. Treat upload and poll endpoints as moderately throttled; back off when `/v1/fetch_tasks_results`/ indicates a queued task instead of polling tightly.

### How do I extract fields from an invoice through Jentic?

Search Jentic for 'extract data from a Koncile invoice', load `/v1/upload_file`/, and execute with the file. Jentic chains the upload, `/v1/fetch_tasks_results`/ polling, and `/v1/fetch_document_data`/ retrieval so the agent receives the parsed fields in one tool call.

### Can I add custom fields to a Koncile template via the API?

Yes. POST `/v1/create_field`/ adds a field to an existing template, and `/v1/create_instruction`/ adds an instruction that tells Koncile how to recognise that field on real documents. Use this to onboard new document types without the dashboard.

### Can I limit what my agent is allowed to do with the Koncile API?

Yes. Because you self-host Jentic One, your own rules decide which Koncile operations and credentials the agent may use, and Koncile's document operations take their targets in the request body rather than the URL path, so you scope by the operation set rather than by path. You can allow just the operations a task needs, such as uploading a file with `/v1/upload_file`/ and reading results with `/v1/fetch_tasks_results`/ and `/v1/fetch_document_data`/, while leaving out configuration operations like `/v1/create_template`/ and `/v1/create_field/.` Anything you do not add to that set is unavailable to the agent.
