Path parameters
-
The SID of the Workspace that the new Worker belongs to.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^WS[0-9a-fA-F]{32}$
.
Body
-
A descriptive string that you create to describe the new Worker. It can be up to 64 characters long.
-
The SID of a valid Activity that will describe the new Worker's initial state. See Activities for more information. If not provided, the new Worker's initial state is the
default_activity_sid
configured on the Workspace.Minimum length is
34
, maximum length is34
. Format should match the following pattern:^WA[0-9a-fA-F]{32}$
. -
A valid JSON string that describes the new Worker. For example:
{ "email": "Bob@example.com", "phone": "+5095551234" }
. This data is passed to theassignment_callback_url
when TaskRouter assigns a Task to the Worker. Defaults to {}.
curl \
--request POST 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Attributes=attributes&ActivitySid=WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Concurrency=5&FriendlyName=friendly_name&OperatingUnitSid=OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
{"Attributes"=>"attributes", "ActivitySid"=>"WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "Concurrency"=>5, "FriendlyName"=>"friendly_name", "OperatingUnitSid"=>"OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics",
"reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations",
"worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
"worker_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
"real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics",
"cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics"
},
"available": false,
"attributes": "{}",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2017-05-30T23:19:38Z",
"date_updated": "2017-05-30T23:19:38Z",
"activity_name": "Offline",
"friendly_name": "NewWorker",
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"consumed_attention": 0,
"operating_unit_sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_status_changed": "2017-05-30T23:19:38Z",
"consumed_concurrency": 0,
"configured_concurrency": -1
}