TaskrouterWorkflow

Create Workflow

POST
/v1/Workspaces/{WorkspaceSid}/Workflows

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

WorkspaceSid*string

The SID of the Workspace that the new Workflow to create belongs to.

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

Request Body

application/x-www-form-urlencoded

FriendlyName*string

A descriptive string that you create to describe the Workflow resource. For example, Inbound Call Workflow or 2014 Outbound Campaign.

Configuration*string

A JSON string that contains the rules to apply to the Workflow. See Configuring Workflows for more information.

AssignmentCallbackUrl?string

The URL from your application that will process task assignment events. See Handling Task Assignment Callback for more details.

Formaturi
FallbackAssignmentCallbackUrl?string

The URL that we should call when a call to the assignment_callback_url fails.

Formaturi
TaskReservationTimeout?integer

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 is 120.

Response Body

application/json

curl -X POST "https://example.com/v1/Workspaces/stringstringstringstringstringstri/Workflows" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'AssignmentCallbackUrl=http%3A%2F%2Fexample.com&Configuration=configuration&FallbackAssignmentCallbackUrl=http%3A%2F%2Fexample.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"  }}