Task Retrieval

The Tasks Retrieval feature of the Koncile API allows you to monitor the real-time status of tasks related to the processing of submitted documents. This feature is essential for integrating automated tracking into your workflows, ensuring optimal management of documents and extracted information.

When you submit a document to Koncile, it is processed in the background. Using the dedicated Tasks Retrieval endpoint, you can:

  • Check the status of a specific task, whether it is completed (DONE), in progress (IN PROGRESS), duplicate (DUPLICATE), or failed (FAILED).

  • Access general extracted information, such as dates, prices, and supplier names, through structured fields.

  • Retrieve detailed line-level data for more precise and granular processing.

Retrieve tasks

GEThttps://api.openai.com/v1/fetch_task_results

Fetch the results from the file upload

Path parameters

Task_id Integer Required The id of the task to retrieve

Returns

Document_id Integer The id from the extracted document

Status String The document extraction status, can be DONE | DUPLICATE | IN PROGRESS | FAILED

Status_message String More informations about the extraction

General_Fields Dict The extracted fields present once in the document

Line_Fields Dict The extracted fields present multiple time in the document lines

To query a specific task via the Koncile API, use the following command. This cURL command allows you to retrieve the status and associated data of a given task using its `task_id`. Be sure to replace `{task_id}` with the task ID and `$API_KEY` with your personal authentication key.

curl api.koncile.ai/v1/fetch_tasks_results/?task_id={task_id} \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY"

Detailed Response Schema (Returned Schemas)

The API returns a JSON structure containing all the necessary information to analyze the status and extracted data of a task. The response is organized into two main sections:

  1. General_fields: Groups the global data extracted from the document, such as the date, total price, and supplier.

  2. Line_fields: Contains detailed line-level information, allowing for a more granular analysis of individual elements.

Below, you will find the exact schema of the response, with the various available fields, their types, and examples of values. This structured format makes it easy to integrate the data into your systems or workflows.

{
	"status": DONE | DUPLICATE | IN PROGRESS | FAILED,
	"document_id": ID,
	"status_message": "",
	"General_fields":
		{
			"Date" : {"value": "05/08/20222", "confidence_score": 0.92},
			"Price" : {"value": "23$", "confidence_score": 0.91},
			"Supplier name" : {"value": "Koncile", "confidence_score": 0.93}
		}
	,
	"Line_fields":
		{
			"Date" : [{"value": "05/08/2022"}, {"value" : "05/09/2022"}, {"value": "03/02/2023"}],
			"Price" : [{"value": "23$"}, {"value": "12$"}, {"value": "5$"}],
			"Supplier name" : [{"value": "Koncile"}, {"value": "Koncile"}, {"value": "Koncile"}]
		}
}

Last updated

Was this helpful?