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 Workflowor2014 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_urlfails. -
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 'AssignmentCallbackUrl=http%3A%2F%2Fexample.com&Configuration=configuration&FallbackAssignmentCallbackUrl=http%3A%2F%2Fexample.com&FriendlyName=friendly_name&TaskReservationTimeout=1'
{"AssignmentCallbackUrl" => "http://example.com", "Configuration" => "configuration", "FallbackAssignmentCallbackUrl" => "http://example.com", "FriendlyName" => "friendly_name", "TaskReservationTimeout" => 1}
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"assignment_callback_url": "http://example.com",
"configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n",
"date_created": "2014-05-14T10:50:02Z",
"date_updated": "2014-05-14T23:26:06Z",
"document_content_type": "application/json",
"fallback_assignment_callback_url": null,
"friendly_name": "Default Fifo Workflow",
"sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"task_reservation_timeout": 120,
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"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"
}
}