TaskrouterTask

Update Task

POST
/v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

WorkspaceSid*string

The SID of the Workspace with the Task to update.

Match^WS[0-9a-fA-F]{32}$
Length34 <= length <= 34
Sid*string

The SID of the Task resource to update.

Match^WT[0-9a-fA-F]{32}$
Length34 <= length <= 34

Header Parameters

If-Match?string

If provided, applies this mutation if (and only if) the ETag header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP If-Match header.

Request Body

application/x-www-form-urlencoded

Attributes?string

The JSON string that describes the custom attributes of the task.

AssignmentStatus?TaskStatus

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

Value in

  • "pending"
  • "reserved"
  • "assigned"
  • "canceled"
  • "completed"
  • "wrapping"
Reason?string

The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason.

Priority?integer

The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647).

TaskChannel?string

When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its unique_name, such as voice, sms, or default.

VirtualStartTime?string

The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future or before the year of 1900.

Formatdate-time

Response Body

application/json

curl -X POST "https://example.com/v1/Workspaces/stringstringstringstringstringstri/Tasks/stringstringstringstringstringstri" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'AssignmentStatus=pending&Attributes=attributes&Priority=1&Reason=reason&VirtualStartTime=2023-08-02T12%3A34%3A56Z'
{  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "age": 25200,  "assignment_status": "pending",  "attributes": "{\"body\": \"hello\"}",  "date_created": "2014-05-14T18:50:02Z",  "date_updated": "2014-05-15T07:26:06Z",  "task_queue_entered_date": "2014-05-14T18:50:02Z",  "virtual_start_time": "2023-08-02T12:34:56Z",  "priority": 0,  "reason": "Test Reason",  "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "task_channel_unique_name": "task-channel",  "timeout": 60,  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "workflow_friendly_name": "Test Workflow",  "task_queue_friendly_name": "Test Queue",  "addons": "{}",  "ignore_capacity": false,  "routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "links": {    "task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",    "workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",    "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",    "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"  }}