TaskrouterV1Task
post/v1/Workspaces/{WorkspaceSid}/Tasks

Request

  • Base URL
    https://taskrouter.twilio.com
  • URL
    https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Tasks
  • Auth
    HTTP basic

Path parameters

WorkspaceSidstring required

The SID of the Workspace that the new Task belongs to.

Request body application/x-www-form-urlencoded

Timeoutinteger

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 description Task TTL Exceeded.

Priorityinteger

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 2^31^ (2,147,483,647).

TaskChannelstring

When MultiTasking is enabled, specify the TaskChannel by passing either its unique_name or sid. Default value is default.

WorkflowSidstring

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.

Attributesstring

A 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" }.

VirtualStartTimestring date-time

The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to date_created. Value can't be in the future or before the year of 1900.

RoutingTargetstring

A SID of a Worker, Queue, or Workflow to route a Task to

IgnoreCapacitystring

A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the RoutingTarget field is set to a Worker SID. By setting IgnoreCapacity to a value of true, 1, or yes, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of IgnoreCapacity is true when the RoutingTarget is set to a Worker SID.

TaskQueueSidstring

The SID of the TaskQueue in which the Task belongs

Response

Created

account_sidstring nullable

The SID of the Account that created the Task resource.

ageinteger

The number of seconds since the Task was created.

assignment_status'pending' | 'reserved' | 'assigned' | 'canceled' | 'completed' | 'wrapping'

The current status of the Task's assignment. Can be: pending, reserved, assigned, canceled, wrapping, or completed.

attributesstring nullable

The JSON string with custom attributes of the work. Note If this property has been assigned a value, it will only be displayed in FETCH action that returns a single resource. Otherwise, it will be null.

addonsstring nullable

An object that contains the Add-on data for all installed Add-ons.

date_createdstring date-time nullable

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updatedstring date-time nullable

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

task_queue_entered_datestring date-time nullable

The date and time in GMT when the Task entered the TaskQueue, specified in ISO 8601 format.

priorityinteger

The current priority score of the Task as assigned to a Worker by the workflow. Tasks with higher priority values will be assigned before Tasks with lower values.

reasonstring nullable

The reason the Task was canceled or completed, if applicable.

sidstring nullable

The unique string that we created to identify the Task resource.

task_queue_sidstring nullable

The SID of the TaskQueue.

task_queue_friendly_namestring nullable

The friendly name of the TaskQueue.

task_channel_sidstring nullable

The SID of the TaskChannel.

task_channel_unique_namestring nullable

The unique name of the TaskChannel.

timeoutinteger

The amount of time in seconds that the Task can live before being assigned.

workflow_sidstring nullable

The SID of the Workflow that is controlling the Task.

workflow_friendly_namestring nullable

The friendly name of the Workflow that is controlling the Task.

workspace_sidstring nullable

The SID of the Workspace that contains the Task.

urlstring uri nullable

The absolute URL of the Task resource.

linksobject nullable

The URLs of related resources.

virtual_start_timestring date-time nullable

The date and time in GMT indicating the ordering for routing of the Task specified in ISO 8601 format.

ignore_capacityboolean nullable

A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the RoutingTarget field is set to a Worker SID. By setting IgnoreCapacity to a value of true, 1, or yes, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of IgnoreCapacity is true when the RoutingTarget is set to a Worker SID.

routing_targetstring nullable

A SID of a Worker, Queue, or Workflow to route a Task to

Changes

    • info

      the response's property default value 0 was added for the status

    • info

      the response's property default value 0 was added for the status

    • info

      the response's property default value 0 was added for the status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status