Path parameters
-
The SID of the Workspace that the new Task belongs to.
Body
-
Attributes string
A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's
assignment_callback_url
when the Task is assigned to a Worker. For example:{ "task_type": "call", "twilio_call_sid": "CAxxx", "customer_ticket_number": "12345" }
. -
Priority integer
The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 231^ (2,147,483,647).
-
TaskChannel string
When MultiTasking is enabled, specify the TaskChannel by passing either its
unique_name
orsid
. Default value isdefault
. -
Timeout integer
The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the
task.canceled
event will fire with descriptionTask TTL Exceeded
. -
WorkflowSid string
The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^WW[0-9a-fA-F]{32}$
.
curl \
-X POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Tasks \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'Attributes=string&Priority=42&TaskChannel=string&Timeout=42&WorkflowSid=string'
{
"Attributes": "string",
"Priority": 42,
"TaskChannel": "string",
"Timeout": 42,
"WorkflowSid": "string"
}
{
"Attributes": "string",
"Priority": 42,
"TaskChannel": "string",
"Timeout": 42,
"WorkflowSid": "string"
}
{
"account_sid": "string",
"addons": "string",
"age": 42,
"assignment_status": "pending",
"attributes": "string",
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"links": {},
"priority": 42,
"reason": "string",
"sid": "string",
"task_channel_sid": "string",
"task_channel_unique_name": "string",
"task_queue_entered_date": "2023-05-04T09:42:00+00:00",
"task_queue_friendly_name": "string",
"task_queue_sid": "string",
"timeout": 42,
"url": "https://example.com",
"workflow_friendly_name": "string",
"workflow_sid": "string",
"workspace_sid": "string"
}
{
"account_sid": "string",
"addons": "string",
"age": 42,
"assignment_status": "pending",
"attributes": "string",
"date_created": "2024-05-04T09:42:00+00:00",
"date_updated": "2024-05-04T09:42:00+00:00",
"links": {},
"priority": 42,
"reason": "string",
"sid": "string",
"task_channel_sid": "string",
"task_channel_unique_name": "string",
"task_queue_entered_date": "2024-05-04T09:42:00+00:00",
"task_queue_friendly_name": "string",
"task_queue_sid": "string",
"timeout": 42,
"url": "https://example.com",
"workflow_friendly_name": "string",
"workflow_sid": "string",
"workspace_sid": "string"
}