Path parameters
-
The SID of the Workspace with the Tasks to read.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^WS[0-9a-fA-F]{32}$
.
Query parameters
-
The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority.
-
The
assignment_status
of the Tasks you want to read. Can be:pending
,reserved
,assigned
,canceled
,wrapping
, orcompleted
. Returns all Tasks in the Workspace with the specifiedassignment_status
. -
The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^WW[0-9a-fA-F]{32}$
. -
The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name.
-
The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^WQ[0-9a-fA-F]{32}$
. -
The
friendly_name
of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. -
The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter.
-
A SID of a Worker, Queue, or Workflow to route a Task to
-
How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as:
Attribute:Order
, whereAttribute
can be eitherDateCreated
,Priority
, orVirtualStartTime
andOrder
can be eitherasc
ordesc
. For example,Priority:desc
returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such asPriority:desc,DateCreated:asc
, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. -
Whether to read Tasks with Add-ons. If
true
, returns only Tasks with Add-ons. Iffalse
, returns only Tasks without Add-ons. -
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum value is
1
, maximum value is1000
. -
The page index. This value is simply for client state.
Minimum value is
0
. -
The page token. This is provided by the API.
curl \
--request GET 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Tasks' \
--user "username:password"
{
"meta": {
"key": "tasks",
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&Priority=1&PageSize=50&Page=0",
"page": 0,
"page_size": 50,
"next_page_url": null,
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&Priority=1&PageSize=50&Page=0",
"previous_page_url": null
},
"tasks": [
{
"age": 25200,
"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"
},
"addons": "{}",
"reason": "Test Reason",
"timeout": 60,
"priority": 0,
"attributes": "{\"body\": \"hello\"}",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2014-05-14T14:26:54Z",
"date_updated": "2014-05-15T16:03:42Z",
"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"ignore_capacity": false,
"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"assignment_status": "pending",
"required_attention": 0,
"virtual_start_time": "2014-05-14T14:26:54Z",
"workflow_friendly_name": "Test Workflow",
"task_queue_entered_date": "2014-05-14T14:26:54Z",
"task_channel_unique_name": "task-channel",
"task_queue_friendly_name": "Test Queue"
}
]
}
{
"meta": {
"key": "tasks",
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&Priority=1&PageSize=50&Page=0",
"page": 0,
"page_size": 50,
"next_page_url": null,
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&Priority=1&PageSize=50&Page=0",
"previous_page_url": null
},
"tasks": []
}
{
"meta": {
"key": "tasks",
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&AssignmentStatus=reserved&Priority=1&PageSize=50&Page=0",
"page": 0,
"page_size": 50,
"next_page_url": null,
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&AssignmentStatus=reserved&Priority=1&PageSize=50&Page=0",
"previous_page_url": null
},
"tasks": []
}