Objective
This article describes how to access TaskRouter Skills defined in the Flex Configuration resource and how to review individual worker attributes to see assigned skills. If you’re looking to fetch the list of skills shown on the Flex “Users and Access > Skills” page, or want to programmatically check which skills are assigned to your agents, this guide will help you accomplish both tasks.
Keywords: Twilio Flex, TaskRouter Skills, Flex Configuration REST API, Worker Attributes, Users and Access Skills.
Product
Twilio Flex, TaskRouter
User Account Permission/Role(s) Required
Owner, Administrator, or Developer role in Console to access REST API credentials in the Twilio Console, or access to
Procedure
1. Accessing TaskRouter Skills via Flex Configuration REST API
To retrieve the full list of Agent Skills configured in your Flex instance (as seen on the Flex Console “Users and Access > Skills” page):
-
Identify the Flex Configuration API endpoint:
The endpoint for the Flex Configuration API:https://flex-api.twilio.com/v1/Configuration -
Authenticate your request:
Use your Twilio Account SID and Auth Token for HTTP Basic Authentication. -
Make the API request:
- You can use any HTTP client (such as Postman, curl, or your preferred programming language).
Example curl command:
curl -u 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:your_auth_token' \
https://flex-api.twilio.com/v1/Configuration/- Be sure to fill in your Account SID, Auth Token!
- The response will include all skills defined in your Flex project.
-
Review the returned skills:
taskrouter_skillswill be returned as a top-level key within the REST API response from the Flex Configuration REST API.
For more details, see the Flex Configuration REST API documentation.
2. Accessing Individual Worker Attributes to Review Skills
To check which skills are assigned to a specific agent (worker):
-
Fetch the Worker resource:
Use the TaskRouter API endpoint:GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid} -
Authenticate your request:
Use your Twilio Account SID and Auth Token. -
Review the worker’s attributes
- The response will include an
attributesfield (JSON format). - Skills are typically listed as part of the worker’s attributes, depending on your Flex configuration.
- The response will include an
-
Make the API request:
- You can use any HTTP client (such as Postman, curl, or your preferred programming language).
Example curl command:
curl -X GET -u 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:your_auth_token' \
"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"- Be sure to fill in your Account SID, Auth Token, Workspace SID, and Worker SID!
- The response will include your Worker's attributes, where Skills will be configured
-
Parse the attributes:
- Your Worker Skills will be available in their Attributes as a subset of the
routingkey asskills. - An example of the layout of the JSON object can be found below:
- Your Worker Skills will be available in their Attributes as a subset of the
{
"routing": {
"tier": "1",
"dept": "support",
"lang": ["en-us"],
"skills": ["charisma", "speech"],
"levels": { "charisma": 10, "speech": 10 }
},
"full_name": "Example Worker",
"image_url": "",
"roles": ["agent", "wfo.full_access"],
"contact_uri": "client:worker_40example_2Ecom",
"email": "worker@example.com",
"disabled_skills": { "skills": [], "levels": {} },
"name": "worker@example.com",
"nickname": "Example"
}For more information, refer to the TaskRouter Worker API documentation.
Additional Information
- While the examples above use curl to access the REST API, the Flex Configuration API is available within our helper libraries as well.