Skip to main content

Status

The status endpoints let you track the lifecycle of operations created via /v1/biz/do.
  • GET /v1/biz/status/:mainTaskId
  • GET /v1/biz/status/:mainTaskId/:fileTaskId
These routes are backed by the ExternalStatusURI, ExternalStatusFileData, and ExternalStatusResponse types.

Status schema

type ExternalStatusFileData = {
  file_key: string; // resulting file key (output if available, otherwise input)
  status: "queued" | "running" | "completed" | "failed";
  download_link?: string; // relative path to download the output file
  error_code?: string; // optional short failure code
  error_message?: string; // optional human-readable message
};

type ExternalStatusResponse = {
  operation_status: "queued" | "running" | "completed" | "failed";
  files_data?: ExternalStatusFileData[];
};

Get main task status

curl -X GET https://api.dragdropdo.com/v1/biz/status/task_abc123 \
  -H "X-D3-API-Key: your-api-key"
Response (completed):
{
  "operation_status": "completed",
  "files_data": [
    {
      "file_key": "file_key_1_result",
      "status": "completed",
      "download_link": "/v1/download/file_key_1_result"
    },
    {
      "file_key": "file_key_2_result",
      "status": "completed",
      "download_link": "/v1/download/file_key_2_result"
    }
  ]
}
Response (failed):
{
  "operation_status": "failed",
  "files_data": [
    {
      "file_key": "file_key_1",
      "status": "failed",
      "error_code": "internal_error",
      "error_message": "Internal server error / invalid input file"
    }
  ]
}

Get specific file task status

curl -X GET https://api.dragdropdo.com/v1/biz/status/task_abc123/file_task_xyz \
  -H "X-D3-API-Key: your-api-key"
When fileTaskId is present, the response narrows to the matching file task (if found).

Polling vs. webhooks

  • Polling – use the status endpoints from your backend or via the official SDK (see SDKs → Node).
  • Webhooks – for production workloads, configure webhooks to receive operation.completed, operation.failed, fileTask.completed, and fileTask.failed events instead of (or in addition to) polling.

Polling example

# Poll in a loop (bash example)
while true; do
  response=$(curl -s -X GET https://api.dragdropdo.com/v1/biz/status/task_abc123 \
    -H "X-D3-API-Key: your-api-key")
  
  status=$(echo $response | jq -r '.operation_status')
  echo "Status: $status"
  
  if [ "$status" = "completed" ] || [ "$status" = "failed" ]; then
    echo $response | jq '.'
    break
  fi
  
  sleep 2
done
See Business API → Webhooks for event payload shapes.