Skip to main content

Twilio TaskRouter

Twilio TaskRouter is a skills-based routing engine that distributes tasks such as calls, chats, and support cases to the most appropriate available worker. It organizes routing around Workspaces, Workers, TaskQueues, Activities, Workflows, and Tasks, and exposes a REST API for managing these resources and retrieving real-time and historical statistics. This connector lets Nexla read TaskRouter resources as a data source and write changes back to TaskRouter as a destination.

Twilio TaskRouter icon

Power end-to-end data operations for your Twilio TaskRouter API with Nexla. Our bi-directional Twilio TaskRouter connector is purpose-built for Twilio TaskRouter, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Twilio TaskRouter or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Twilio TaskRouter workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a Twilio TaskRouter credential, you need a Twilio account and the identifiers for the TaskRouter Workspace you want to work with. The TaskRouter API uses HTTP Basic Authentication, where your Twilio Account SID is the username and your Twilio Auth Token is the password.

To obtain your credentials, follow these steps:

  1. Sign in to the Twilio Console.

  2. From the Console dashboard, locate your Account SID and Auth Token in the Account Info panel. The Account SID is used as the Basic Auth username, and the Auth Token is used as the Basic Auth password. Keep the Auth Token confidential.

  3. Navigate to the TaskRouter section of the Console and open Workspaces. Select the Workspace you want to connect to and copy its Workspace SID. Every TaskRouter API request is scoped to a Workspace, so this identifier is required.

  4. If you plan to update or delete individual resources, also copy the relevant Worker SID, Task Queue SID, or Activity SID for those resources from within the Workspace. These are optional and only needed for the corresponding write operations.

For details about TaskRouter resources, authentication, and available endpoints, see the Twilio TaskRouter Documentation.

Authenticate

Credentials required

FieldRequiredSecretDescription
UsernameYesNoTwilio Account SID, used as the Basic Auth username.
PasswordYesYesTwilio Auth Token, used as the Basic Auth password.
Workspace SIDYesNoThe SID of the TaskRouter Workspace to operate against. Required by every endpoint.
Worker SIDNoNoThe SID of the Worker to update or delete. Used by worker write endpoints.
Task Queue SIDNoNoThe SID of the TaskQueue to update or delete. Used by task queue write endpoints.
Activity SIDNoNoThe SID of the Activity to update. Used by activity write endpoints.

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

  2. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  3. Enter your Twilio Account SID in the Username field and your Twilio Auth Token in the Password field. These are used as the Basic Auth username and password for all TaskRouter API requests.

  4. Enter the Workspace SID for the TaskRouter Workspace you want to connect to. This value scopes every request to a specific Workspace and is required.

  5. Optionally, enter a Worker SID, Task Queue SID, or Activity SID if you intend to update or delete those specific resources.

    The Twilio Auth Token grants full access to your Twilio account and should be treated as sensitive information. If it is compromised, rotate it from the Twilio Console and update your Nexla credential.

    For more information about authentication and TaskRouter resources, see the Twilio TaskRouter Documentation.

  6. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Twilio TaskRouter connector tile, then select the credential that will be used to connect to Twilio TaskRouter, and click Next; or, create a new Twilio TaskRouter credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Twilio TaskRouter endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

[Rest API] List Workspaces

Retrieve all TaskRouter Workspaces.

  • Use this endpoint to enumerate the Workspaces available to your Twilio account. It is a useful starting point for discovering the Workspace SID values needed to configure other endpoints.

[Rest API] List Workers

Retrieve all Workers in a TaskRouter Workspace.

  • Returns the Workers registered in the configured Workspace, including their attributes and current activity status.

[Rest API] List Task Queues

Retrieve all TaskQueues in a TaskRouter Workspace.

  • Returns the TaskQueues defined in the configured Workspace, which group Tasks for routing to Workers.

[Rest API] List Activities

Retrieve all Activities in a TaskRouter Workspace.

  • Returns the Activities (Worker status values, such as Available or Offline) defined in the configured Workspace.

[Rest API] List Workflows

Retrieve all Workflows in a TaskRouter Workspace.

  • Returns the Workflows in the configured Workspace, which define the rules that route Tasks to TaskQueues.

[Rest API] List Tasks

Retrieve all Tasks in a TaskRouter Workspace.

  • Returns the Tasks in the configured Workspace, including their attributes, assignment status, and routing state.

[Rest API] List Events

Retrieve the historical Event log for a TaskRouter Workspace (audit/reporting).

  • Returns the historical Event log for the configured Workspace, useful for auditing and reporting on routing activity over time.

[Rest API] Get Workspace Real-Time Statistics

Retrieve real-time statistics (worker/task/queue counts) for a TaskRouter Workspace.

  • Returns current real-time statistics for the configured Workspace, including Worker, Task, and queue counts for operational monitoring.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

Twilio TaskRouter data sources can also be manually configured to ingest data from any valid TaskRouter API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Twilio TaskRouter data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.

Use as a destination

Click the + icon on the Nexset that will be sent to the Twilio TaskRouter destination, and select the Send to Destination option from the menu. Select the Twilio TaskRouter connector from the list of available destination connectors, then select the credential that will be used to connect to Twilio TaskRouter, and click Next; or, create a new Twilio TaskRouter credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Twilio TaskRouter endpoints. Select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

[Rest API] Create Workspace

Create a new TaskRouter Workspace.

  • Each record from your Nexset is sent as a request to create a new TaskRouter Workspace with the provided properties.

[Rest API] Update Workspace

Update an existing TaskRouter Workspace by SID.

  • Each record updates an existing Workspace identified by its SID with the provided properties.

[Rest API] Delete Workspace

Delete a TaskRouter Workspace by SID.

  • Each record deletes the Workspace identified by its SID. This operation is irreversible.

[Rest API] Create Worker

Create a new Worker in a TaskRouter Workspace.

  • Each record from your Nexset is sent as a request to create a new Worker in the configured Workspace.

[Rest API] Update Worker

Update an existing Worker in a TaskRouter Workspace.

  • Each record updates an existing Worker, identified by its SID, with the provided properties such as attributes or activity.

[Rest API] Delete Worker

Delete a Worker from a TaskRouter Workspace by SID.

  • Each record deletes the Worker identified by its SID. This operation is irreversible.

[Rest API] Create Task Queue

Create a new TaskQueue in a TaskRouter Workspace.

  • Each record from your Nexset is sent as a request to create a new TaskQueue in the configured Workspace.

[Rest API] Update Task Queue

Update an existing TaskQueue by SID.

  • Each record updates an existing TaskQueue, identified by its SID, with the provided properties.

[Rest API] Delete Task Queue

Delete a TaskQueue from a TaskRouter Workspace by SID.

  • Each record deletes the TaskQueue identified by its SID. This operation is irreversible.

[Rest API] Create Activity

Create a new Activity (worker status) in a TaskRouter Workspace.

  • Each record from your Nexset is sent as a request to create a new Activity, representing a Worker status value, in the configured Workspace.

[Rest API] Update Activity

Update an existing Activity by SID.

  • Each record updates an existing Activity, identified by its SID, with the provided properties.

[Rest API] Create Workflow

Create a new Workflow in a TaskRouter Workspace.

  • Each record from your Nexset is sent as a request to create a new Workflow, which defines Task routing rules, in the configured Workspace.

Manual configuration

Twilio TaskRouter destinations can also be manually configured to send data to any valid TaskRouter API endpoint. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, attribute exclusions, record batching, and response webhooks.

Save & activate

Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To send the data to the configured Twilio TaskRouter endpoint, open the destination resource menu, and select Activate.

The Nexset data will not be sent to the Twilio TaskRouter endpoint until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.