# Installation

## Setup Twilio

### Step 1: Purchase a Twilio phone number compatible with Programmable Messaging

To get started, you will need to create a Twilio account and purchase a phone number in the country of your choice. [Twilio has a documentation on this topic](https://support.twilio.com/hc/en-us/articles/223135247-How-to-Search-for-and-Buy-a-Twilio-Phone-Number-from-Console). The only point of attention is that you must make sure that the number you purchase has Messaging capabilities. Please keep in mind that depending on your country of origin, the requirements may differ, and Twilio may ask you for business verification. Keep track of this phone number (including the country code) as you are going to need to add it later to CSML Studio!

### Step 2: Configure the messaging webhook

To configure the webhook, you can either use a TwiML app, or directly set a webhook in the messaging configuration panel. Either way, you will need to set the HTTP POST webhook to <https://clients.csml.dev/v1/twilio/sms/request>, for example like so:

![](/files/-Mdb8qxTj7C9QZQ2_AOI)

### Step 3: Security and Authorization

The last step is to provide CSML Studio with means to make sure that the requests that are sent to the Twilio Voice endpoint are indeed coming from Twilio. To do so, [visit your Twilio Project Settings](https://www.twilio.com/console/project/settings) and **copy your Account SID and Auth Token**, found under API Credentials:

![](/files/-MMLP1TowDKjv9QdEbSO)

## Setup CSML Studio

To setup your Twilio SMS channel in CSML Studio, you will simply need to visit the Channels section and create a new Twilio SMS channel. Then simply fill the required fields with the information you gathered earlier.

![](/files/-MdYpGqBAg7QNT6IO_A2)

Once you click on **Submit**, your bot is ready to use!

![](/files/-MdbCpnjz70aiSWTT8kr)


---

# Agent Instructions: 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:

```
GET https://docs.csml.dev/studio/channels/twilio-sms/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
