Path parameters
-
The SID of the Workspace that the new Workflow to create 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 Workflow resource. For example,
Inbound Call Workflow
or2014 Outbound Campaign
. -
A JSON string that contains the rules to apply to the Workflow. See Configuring Workflows for more information.
-
The URL from your application that will process task assignment events. See Handling Task Assignment Callback for more details.
-
The URL that we should call when a call to the
assignment_callback_url
fails. -
How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to
86,400
(24 hours) and the default is120
.
curl \
--request POST 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workflows' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'FriendlyName=friendly_name&Configuration=configuration&AssignmentCallbackUrl=http%3A%2F%2Fexample.com&TaskReservationTimeout=1&FallbackAssignmentCallbackUrl=http%3A%2F%2Fexample.com'
{"FriendlyName"=>"friendly_name", "Configuration"=>"configuration", "AssignmentCallbackUrl"=>"http://example.com", "TaskReservationTimeout"=>1, "FallbackAssignmentCallbackUrl"=>"http://example.com"}
{
"sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
"real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
"cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics"
},
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2014-05-14T10:50:02Z",
"date_updated": "2014-05-14T23:26:06Z",
"configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n",
"friendly_name": "Default Fifo Workflow",
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"document_content_type": "application/json",
"assignment_callback_url": "http://example.com",
"task_reservation_timeout": 120,
"fallback_assignment_callback_url": null
}