Skip to content

Retrieve a task.

Method

GET https://papi.afi.ai/api/v1/tenants/{tenant_id}/tasks/{task_id}

Description

Retrieves a task object by its ID.

Poll the task status using exponentially increasing intervals while waiting for completion: Start at 15 seconds and double the interval up to 4 minutes (15 s, 30 s, 60 s, 2 min, 4 min). Polling more frequently is unnecessary; the cached state will not change sooner and doing so increases the likelihood of HTTP 429 errors because of rate limits.

Path params
tenant_id string required

Tenant ID that owns the task.

task_id string required

ID of the task to retrieve.

curl -X GET \
    -H 'Authorization: {api-key}' \
    https://papi.afi.ai/api/v1/tenants/{tenant_id}/tasks/{task_id}

Successful response (200) schema
object

Task describes a single task.

id string

Task ID.

resource_id string

ID of the resource with which the task is associated.

status string

Task status. Valid values: `open`, `inprogress`, `done`, `failed`, `suspended`, `warnings`, `canceled`. The `done`, `failed`, `warnings`, and `canceled` statuses are terminal. The `warnings` status indicates that the task completed with warnings that might require attention.

Response example
{
  "id": "string",
  "resource_id": "string",
  "status": "string"
}