> For the complete documentation index, see [llms.txt](https://docs.balkan.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.balkan.id/getting-started/setting-up-your-tenant/application-integrations/direct-application-integrations/twilio-integration-setup.md).

# Twilio Integration Setup

### Getting Started

Use this guide to connect Twilio to your BalkanID tenant. You will need credentials from the Twilio Console and access to the Integrations section in BalkanID.

{% hint style="info" %}
Twilio integration requires **Twilio Organizations**. The users, roles and accounts BalkanID reads are organization-level resources, and the APIs behind them are only available to accounts with Organizations enabled.
{% endhint %}

#### Requirements:

Before you begin, collect the following values from Twilio:

* **Client ID**
* **Client Secret**
* **Organization SID**

### Configure Twilio within your BalkanID tenant

1. To find the Client ID and Client Secret, sign in to the Twilio Console as an Organization Owner or Organization Admin.
2. Navigate to **Settings** > **Organization settings** > **Organization API access**, then click **Create OAuth application**.
3. Choose the **Client Credentials** grant type. This is a machine-to-machine credential, so there is no redirect URL to configure and no user consent step.
4. At the **Scopes & permissions** step, select all `managed-users` scopes, plus `twilio/iam/roles/list`, `twilio/iam/role-assignments/list` and `twilio/iam/accounts/list` (see [Integration Scopes](#integration-scopes) below). Complete the app creation.
5. Copy the Client ID and Client Secret from the **Copy secret** page. The secret is shown only once — store it securely before continuing. You can find the Client ID again later on the application's **Credentials** tab, and rotate the secret from there if needed.
6. From **Settings** > **Organization settings**, copy your Organization SID. It begins with `OR`.
7. In BalkanID, go to **Integrations** and click **Add integration**.

<div data-with-frame="true"><figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FtrOJhhA3lhSVeUTJokwt%2Ftwilio-add-integration.png?alt=media" alt="The BalkanID Integrations page with the Add integration button in the top right"><figcaption><p>Integrations</p></figcaption></figure></div>

8. Select **Twilio** from the application list, then click **Next**.

<div data-with-frame="true"><figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FDL391y531W22hYHtuP7O%2Ftwilio-connect-new-application.png?alt=media" alt="Twilio selected in the Connect a new application step"><figcaption><p>Connect a new application</p></figcaption></figure></div>

9. Set the **Primary application owner** and a **Description**, if any. Under **Select Extraction Type**, keep **Direct Configuration** selected and paste your **Client ID**, **Client Secret** and **Organization SID** into the corresponding fields, then click **Next.**

<div data-with-frame="true"><figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FrDbYrOhSGOZUifcg1FeV%2Ftwilio-direct-configuration.png?alt=media" alt="The Direct Configuration fields for Client ID, Client Secret and Organization SID"><figcaption><p>Direct Configuration</p></figcaption></figure></div>

10. Fill **Optional Configuration**, if required.

<div data-with-frame="true"><figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FZbipc8nl8LTFl5YsVIaj%2Foptional-configuration.png?alt=media" alt="Reviewer settings and fulfillment options in the Optional Configuration step"><figcaption><p>Optional Configuration</p></figcaption></figure></div>

11. Once you have filled in the information, click **Save**. Your integration is now configured and you will see the status of the integration displayed alongside other integrations on the Integrations page. When data is available, the integration Status column will read **Connected** and the integration Message will read **Data available**.

### Integration Scopes

BalkanID reads Twilio data only. None of the scopes below grant write access.

| Read Only Scopes                                                                            | Lifecycle Management Scopes |
| ------------------------------------------------------------------------------------------- | --------------------------- |
| **managed-users (Read)** — the users in your Twilio organization                            | N/A                         |
| **twilio/iam/roles/list** — the roles available in your organization                        | N/A                         |
| **twilio/iam/role-assignments/list** — which users hold which roles, and at which scope     | N/A                         |
| **twilio/iam/accounts/list** — the accounts and sub-accounts users can be granted access to | N/A                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.balkan.id/getting-started/setting-up-your-tenant/application-integrations/direct-application-integrations/twilio-integration-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
