file-linesDocuments

Documents hold the extracted data from your uploaded files. Use these endpoints to retrieve document IDs, access extracted data, download original files, and manage documents.

Fetch Documents

GET https://api.koncile.ai/v1/fetch_documents

Fetches a list of all document IDs in your company.

Query parameters

start_date Date Optional Filter documents created on or after this date (format: YYYY-MM-DD)

end_date Date Optional Filter documents created on or before this date (format: YYYY-MM-DD)

Returns

An array of document IDs.

curl api.koncile.ai/v1/fetch_documents \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY"

# With date filters
curl "api.koncile.ai/v1/fetch_documents?start_date=2024-01-01&end_date=2024-12-31" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY"

Fetch Document Data

GET https://api.koncile.ai/v1/fetch_document_data

Fetches the extracted data from a specific document.

Query parameters

document_id Integer Required The id of the document to fetch

Returns

document_id Integer The document identifier

template_id Integer The template used for extraction

document_name String Original filename

General_fields Object Fields extracted once per document, with values and confidence scores

General_fields_list Array Same general fields as a list format

Line_fields Object Fields extracted for each line item, with arrays of values and confidence scores

task_id String Associated task ID (if applicable)


Fetch File

GET https://api.koncile.ai/v1/fetch_file

Downloads the original file associated with a document.

Query parameters

document_id Integer Conditional The document identifier. Required if task_id is not provided

task_id String Conditional The task identifier. Required if document_id is not provided

Provide either document_id OR task_id, but not both.

Returns

The file as a binary stream.


Fetch Files Batch

POST https://api.koncile.ai/v1/fetch_files_batch

Downloads multiple files at once and returns them as a ZIP archive.

Request body

document_ids Array[Integer] Conditional List of document IDs to download

task_ids Array[String] Conditional List of task IDs to resolve to documents

At least one of document_ids or task_ids must be provided. You can provide both to combine results.

Returns

A ZIP file containing all requested files.


Delete Document

DELETE https://api.koncile.ai/v1/delete_doc

Removes a document from the system.

Query parameters

doc_id Integer Required The id of the document to delete

delete_file Boolean Optional If true, also deletes the underlying file. Default: false

Returns

Empty response on success.

Last updated

Was this helpful?