> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lumos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio Flex

*This article covers the Twilio Flex connector, which syncs Flex UI users through their TaskRouter workers. It's a separate connector from the base Twilio integration.*

## After this article

You will be able to connect Twilio Flex to Lumos to sync Flex UI users, track their last activity and entitlements, and deprovision users for offboarding and Access Reviews.

## Capabilities

| Functionality | Type | Sync | Provision | Description |
| - | - | - | - | - |
| Users | Account | Yes | No | Active Twilio Flex users for the connecting account. Lumos lists workspaces, then lists workers, and each worker maps to a Flex UI user |

| AppStore | Offboarding | Access Reviews | License Management |
| - | - | - | - |
| N/A | Yes | Yes | Yes |

| Deprovisioning Action | Type | Description |
| - | - | - |
| Delete | User | Marks the Lumos Account Status as **Deprovisioned** and deletes the TaskRouter worker that represents the Flex UI user in Twilio Flex |

**Entitlements:** Lumos reads two entitlement types per user. **Account Type** is given to every user and indicates the user represents a Twilio Flex UI user. **Account Roles** are the account's Flex UI user roles, plus any additional roles passed in from an IdP as attributes when a user logs in via SSO (from the worker's `attributes.roles` field).

**Last activity:** for an inactive or offline Flex UI user (a worker whose `activity_name` is `Offline` or `Unavailable`), last activity is the worker's `date_status_changed` value. If the user is active while data is syncing, last activity is the current sync time.

## Required plan and roles

* **Twilio plan:** no plan is required. Even trial accounts can be connected.
* **API key type:** Lumos only supports connecting with API keys from Twilio **accounts**, not subaccounts. Lumos also only supports **Main** API keys, not standard or restricted API keys.

## Read-only access vs provisioning

**Is read-only possible?** No. Lumos only supports Main API keys on Twilio accounts, not standard or restricted keys, so there's no narrower credential available to limit the connection to read-only.

**What full provisioning requires.** The same Main API key and Account SID used to connect. That credential is also what Lumos uses to delete the TaskRouter worker behind a Flex UI user during deprovisioning, so no separate credential is needed.

**Watch out for.** Deprovisioning here deletes the underlying TaskRouter worker rather than suspending it. Unlike the base Twilio connector, there's no reversible suspend action for Flex users.

## Instructions

**Phase 1: Gather credentials in Twilio**

1. Log in to Twilio.
2. On the Twilio homepage, use the account selector at the top left to select the account you want to connect.
3. At the bottom of the accounts page, copy the **Account SID**. You'll use this for the **Account SID** value in Lumos.
4. At the top right, open the **Account** dropdown and go to **API Keys & Tokens**.
5. Click **Create API Key**.
6. Select **Main** in the **Key Type** dropdown. Lumos recommends giving the key an identifiable friendly name like "Lumos Main API Key."
7. Click **Create**. You'll be redirected to a **Copy Secret Key** page.
8. Copy the **SID** and the **Secret**. You'll use the SID for the **API Key SID** value in Lumos and the Secret for the **API Key Secret** value in Lumos.

**Phase 2: Connect in Lumos**

1. Find the Twilio Flex card in your Lumos integrations (reconnect an existing card or add a new one).
2. Paste your **Account SID** into the **Account SID** field.
3. Paste your **API Key SID** into the **API Key SID** field.
4. Paste your **API Key Secret** into the **API Key Secret** field.
5. Click **Connect Twilio Flex**.

## API Endpoints Used

<Note>
  The API endpoints this integration uses are available to logged-in Lumos customers. [Log in](/login) to view them.
</Note>

## Troubleshooting

**Connection fails during setup.** Confirm you used an API key from a Twilio account (not a subaccount) and that it's a Main API key, not a standard or restricted key. Re-check that the Account SID, API Key SID, and API Key Secret all match the values from Twilio.
