Skip to main content
Retrieve the progress status for tasks associated with a specific prompt application. This endpoint is useful for monitoring the status of running tasks.

Get Task Progress

const API_KEY = process.env.TELA_API_KEY;
const promptApplicationId = 'prompt_application_uuid';

const url = new URL('https://api.tela.ai/task/progress');
url.searchParams.append('promptApplicationId', promptApplicationId);

// Optional parameters
url.searchParams.append('limit', '10');
url.searchParams.append('offset', '0');

const response = await fetch(url, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);

Parameters

NameTypeRequiredDescription
promptApplicationIdstringYesThe UUID of the prompt application to get task progress for
promptApplicationVersionIdstringNoFilter by specific prompt application version
limitstringNoNumber of results to return
offsetstringNoNumber of results to skip for pagination
objectLinksstringNoInclude object links in response

Response

The response returns progress information for tasks associated with the specified prompt application.
FieldTypeDescription
dataarrayArray of task progress objects
metadataobjectPagination and additional metadata

Task Progress Object

FieldTypeDescription
taskIdstringUnique identifier for the task
promptApplicationIdstringUUID of the associated prompt application
statusstringCurrent status: created, running, validating, completed, failed, or cancelled
progressobjectProgress details including currentStep, percentage, and totalSteps
currentStepInfoobjectInformation about the current processing step

Example Response

{
  "data": [
    {
      "taskId": "550e8400-e29b-41d4-a716-446655440000",
      "promptApplicationId": "550e8400-e29b-41d4-a716-446655440001",
      "status": "running",
      "progress": {
        "currentStep": 2,
        "percentage": 66,
        "totalSteps": 3
      },
      "currentStepInfo": {
        "name": "Processing document",
        "startedAt": "2023-01-01T00:01:00.000Z"
      }
    },
    {
      "taskId": "550e8400-e29b-41d4-a716-446655440002",
      "promptApplicationId": "550e8400-e29b-41d4-a716-446655440001",
      "status": "completed",
      "progress": {
        "currentStep": 3,
        "percentage": 100,
        "totalSteps": 3
      },
      "currentStepInfo": {}
    }
  ],
  "metadata": {
    "total": 2,
    "limit": 10,
    "offset": 0
  }
}

Status Values

StatusDescription
createdTask has been created but not yet started
runningTask is currently being processed
validatingTask output is being validated
completedTask has completed successfully
failedTask encountered an error
cancelledTask was cancelled