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

# Inbound calls with Twilio

> Setting up a voice agent to receive phone calls for you

<Note>
  You will need:

  * A Twilio account
  * A Twilio phone number (can be a trial number)
  * Your Twilio Account SID and Auth Token
</Note>

This guide walks you through configuring Layercode to answer calls to your Twilio phone number.

<Card>
  If you'd like to trigger outbound calls from your Layercode Agent, see [Outbound calls with Twilio](/how-tos/outbound-calls).
</Card>

1. Go to the Layercode dashboard at [https://dash.layercode.com](https://dash.layercode.com) and select your agent.
2. Open the client settings, enable Twilio phone calls, and then save changes.

<img className="mx-auto mb-8" src="https://mintcdn.com/layercode/9oeDU9cufqK-WC8r/images/edit-client-twilio.png?fit=max&auto=format&n=9oeDU9cufqK-WC8r&q=85&s=236aa2a15b8439c1ebb918ac66c47bb1" alt="Edit client for Twilio" width="878" height="1116" data-path="images/edit-client-twilio.png" />

3. Go to the Layercode settings at [https://dash.layercode.com/settings](https://dash.layercode.com/settings).
4. Add your Twilio Account SID and Auth Token, then save.

<img className="mx-auto mb-8" src="https://mintcdn.com/layercode/9oeDU9cufqK-WC8r/images/twilio-credentials.png?fit=max&auto=format&n=9oeDU9cufqK-WC8r&q=85&s=6f65ee33ad5c4f382ad60ea29add3a0f" alt="Save Twilio credentials" width="1236" height="554" data-path="images/twilio-credentials.png" />

<Note>
  Twilio recently changed where the Auth Token and Account SID are displayed. In the Twilio Console, use the search bar to find “Account SID” and “Auth Token”.
</Note>

5. Return to your agent's client settings. You should now be able to select a Twilio phone number.

<Note>
  If you don't see your number, refresh the page. Ensure the number is in the same Twilio account as the credentials you added.
</Note>

<Info>
  You can assign multiple Twilio phone numbers to a single agent. For each call, Layercode stores the <code>from</code>/<code>to</code> phone numbers (and country codes) on the session. See the [REST API](/api-reference/rest-api#sessions) for retrieving these details along with transcripts and recordings.
</Info>

6. Test by calling the number. For a quick check, set a short welcome message in Layercode (for example, "Hello from Layercode").

7. To run Twilio in production, you will need a backend where you can run your LLM flow. You should review one of our backend tutorials, for example, check out our [Next.js quick start](/tutorials/getting-started.mdx). And you can consult the [reference on webhooks](/api-reference/webhook-sse-api#webhook-request-payload) to see how you can receive the `from_phone_number` and `to_phone_number`.
