Skip to main content
GET
https://agentgate.mynewapi.com
/
api
/
v1
/
queue
/
position
/
{workOrderId}
Get Queue Position
curl --request GET \
  --url https://agentgate.mynewapi.com/api/v1/queue/position/{workOrderId} \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "workOrderId": "<string>",
    "position": 123,
    "state": "<string>",
    "enqueuedAt": "<string>",
    "estimatedStartTime": "<string>"
  }
}

Get Queue Position

Returns the position of a specific work order in the queue.

Request

workOrderId
string
required
The ID of the work order to look up
curl https://agentgate.mynewapi.com/api/v1/queue/position/wo_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Queue position data

Example Response

Waiting in Queue

{
  "success": true,
  "data": {
    "workOrderId": "wo_abc123",
    "position": 5,
    "state": "waiting",
    "enqueuedAt": "2024-01-15T10:25:00.000Z",
    "estimatedStartTime": "2024-01-15T10:35:00.000Z"
  },
  "requestId": "req_xyz789"
}

Currently Running

{
  "success": true,
  "data": {
    "workOrderId": "wo_abc123",
    "position": 0,
    "state": "running",
    "enqueuedAt": "2024-01-15T10:20:00.000Z"
  },
  "requestId": "req_xyz789"
}

Error Responses

Work Order Not Found

{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Work order not found in queue: wo_abc123"
  },
  "requestId": "req_xyz789"
}
This endpoint only returns position for work orders currently in the queue. For completed or cancelled work orders, use the Get Work Order endpoint instead.