Status API
Use the Status API to check the status of a running execution. This endpoint allows you to track the execution initiated via the Execution API.
Request
Endpoint | /deployment/api/<organization_id>/<api_name> |
URL | https://us-central.unstract.com/deployment/api/<organization_id>/<api_name>/ |
Method | GET |
Headers | Authorization: Bearer <YOUR API KEY> |
Body | None |
Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
execution_id | string | -- | Yes | The ID of the execution. You can find it in the Execution API response or the API Deployment logs. |
include_metadata | boolean | false | No | If this parameter is true , metadata of the result is included; otherwise, it is not.Note: This flag works only with tools exported from Prompt Studio. It contains usage and cost details of the LLMs and embeddings used. |
Example Curl Request
curl -X GET --location 'https://globe.unstract.com/deployment/api/org_HJqNgodUQsA99S3A/dasda/?execution_id=e748d90f-af7d-4a98-813d-4c47344ff595' \
--header 'Authorization: Bearer <Your API Key>'
Response
Refer to Possible HTTP Status Codes for a complete list of status codes.
Example 200
Response
{
"status": "COMPLETED",
"message": [
{
"file": "abc.pdf",
"status": "Success",
"result": {
"input_file": "abc.pdf",
"result": "unknown"
},
"metadata": {
"source_name": "abc.pdf",
"source_hash": "9bfb3c389658c442101e8c01c7f5eb722e2440297c490a63bf2a848083067da9",
"organization_id": "ABCD",
"workflow_id": "152d2209-af26-474b-b57b-1b786c8a046c",
"execution_id": "<Id of execution at which the file actually executed without using file history>",
"total_elapsed_time": "<total time of execution>",
"tool_metadata": [
{
"tool_name": "classify",
"elapsed_time": "<Tool execution time>",
"output_type": "JSON"
}
]
}
}
]
}
Example with result-metadata
{
"status": "COMPLETED",
"message": [
{
"file": "invoice-nov.pdf",
"status": "Success",
"result": {
"metadata": {
"context": {
// Contextual data useed for LLM call extracted from the document, organized by prompt key
},
"embedding": [
// Cost, token consumption, and other metrics related to embedding generation
],
"extraction_llm": [
// Performance details and cost breakdown for the LLM-based extraction process
],
"file_name": "<Name of the processed file>",
"highlight_data": {
// Information on highlighted text, including location and content
},
"required_fields": {
// Status and validation of mandatory document fields
},
"run_id": // Unique identifier for the processing run
},
"output": {
// Structured data extracted from the document
}
},
"error": "<Detailed error description if processing failed (Optional)>",
"metadata": {
"source_name": "<Original file name as provided>",
"source_hash": "<Unique hash value for file integrity verification>",
"organization_id": "<Unique identifier for the organization>",
"workflow_id": "<Unique identifier for the workflow used>",
"execution_id": "<Unique identifier for the workflow execution>",
"file_execution_id": "<Unique identifier for this specific file execution same as run_id>",
"tags": "<List of tags used during API execution>",
"total_elapsed_time": "<Total time taken for processing the file in seconds>",
"tool_metadata": "<Details of tools used during processing, including tool names, elapsed time, and output type>"
}
}
]
}
Possible Execution status
Status | Description |
---|---|
PENDING | The execution is still being processed. Check back later. |
QUEUED | The task has been queued for asynchronous execution. Check back later. |
INITIATED | The execution has been initiated and will begin soon. Check back later. |
READY | The execution is ready for the build phase. Check back later. |
EXECUTING | The execution currently being executed. Please check again later. |
COMPLETED | The execution has been successfully completed, either fully or partially. |
ERROR | The API encountered an error during execution, or all file executions have failed. |