DoclingDocling for IBM watsonx
API Reference

Poll Status

Check the status of document conversion tasks

Poll Status

Check the progress and status of a document conversion task.

Endpoint

GET /v1/status/poll/{task_id}

Authentication

All requests require authentication using the X-Api-Key header with your API key.

Path Parameters

ParameterTypeRequiredDescription
task_idstringYesThe task ID returned from a conversion request

Request Headers

HeaderRequiredDescription
X-Api-KeyYesYour API key for authentication

Response

Success Response (200 OK)

Returns the current status of the conversion task:

{
  "task_id": "abc123def456",
  "task_type": "convert",
  "task_status": "success",
  "task_position": null,
  "task_meta": null,
  "failure": null,
  "error_message": null
}
FieldTypeDescription
task_idstringThe unique identifier for this task
task_typestringAlways "convert" for conversion tasks
task_statusstringCurrent status (see Status Values)
task_positionintegerPosition in queue (null when processing or complete)
task_metaobjectAdditional metadata (currently unused)
failureobjectFailure details if the task failed, otherwise null
error_messagestringError description if status is "failure", otherwise null

Status Values

StatusDescriptionNext Action
pendingTask is queued and waiting to be processedContinue polling
processingConversion is currently in progressContinue polling
successTask completedRetrieve the conversion results
failureTask failed with an errorCheck the failure and error_message fields for details

Error Responses

See Error Handling for the full error model.

StatusDescription
401Unauthorized — missing or invalid API key
404Not found — the task ID doesn't exist or has expired
429Too many requests — rate limit exceeded
500Internal server error

Examples

Find examples of using the Status endpoint in the Examples section.

Polling Best Practices

Poll the status endpoint until task_status is success or failure, using exponential backoff to avoid unnecessary requests. Start at 1–2 seconds and increase the delay up to a cap (for example, 30 seconds).

#!/bin/bash
TASK_ID="abc123def456"
DELAY=1

while true; do
  RESPONSE=$(curl -s -X GET "${DOCLING_SERVICE_URL}/v1/status/poll/${TASK_ID}" \
    -H "X-Api-Key: ${DOCLING_API_KEY}")

  STATUS=$(echo "$RESPONSE" | jq -r '.task_status')

  if [ "$STATUS" = "success" ]; then
    echo "Conversion complete"
    break
  elif [ "$STATUS" = "failure" ]; then
    echo "Conversion failed: $(echo "$RESPONSE" | jq -r '.error_message')"
    exit 1
  fi

  sleep "$DELAY"
  DELAY=$((DELAY * 2))
  [ "$DELAY" -gt 30 ] && DELAY=30
done

The Python SDK polls for you — client.convert(...) submits, polls, and returns the final result, so you don't need to implement this yourself.

Common Issues

Task not found (404) — the task_id is incorrect, was never created successfully, or the task has expired. Verify you're using a task_id returned from a recent conversion request.

Task stuck in pending — a high task_position indicates queue load; the task starts once it reaches the front of the queue. If it stays pending far longer than expected, retry the conversion or contact support.

Polling too frequently (429) — you're exceeding the rate limit. Use exponential backoff (see Polling Best Practices) rather than a tight loop.

Task Lifecycle

  1. Submit — the conversion request returns a task_id
  2. Pending — the task is queued (check task_position)
  3. Processing — conversion in progress
  4. Complete — status is either success or failure; success means the task finished, not necessarily that every document converted
  5. Retrieve — get result artifacts and per-document statuses, or handle the task-level error

Next Steps

Once the status is "success":

  1. Retrieve results - Use the /v1/result/{task_id} endpoint to get result artifacts, download URLs, and document-level statuses
  2. Process the output - Check result counters and document statuses, then download artifacts for successful documents

On this page