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

# Connect a phone number to your weya voice agents

> Bring a phone number from Twilio, Plivo, Telnyx, Exotel, Vobiz, Elisiontec, jambonz or your own SIP trunk into weya and assign the agents that use it.

weya places and answers calls through phone numbers you already own with a telephony provider. You add the number with your provider credentials, then assign the agents that use it: an **outbound agent** that makes campaign calls from the number, and an **inbound agent** that answers calls to it.

## Supported providers

| Provider | Credentials weya asks for |
| - | - |
| Twilio | Account SID and Auth Token |
| Plivo | Auth ID and Auth Token |
| Telnyx | API key |
| SIP trunk | SIP host, port, username, password, "from" user, transport (`udp`, `tcp` or `tls`) and whether to register |
| Exotel, Vobiz, jambonz | Your account details for that provider |
| Elisiontec | Your account details and the Elisiontec list ID |

The number must belong to the provider account whose credentials you enter. weya checks the credentials before saving the number, then sets up the provider's call status and recording callbacks for you.

## Add a number

**1. Open Phone Numbers**

In the dashboard, go to **Phone Numbers**, click **Add Number** and choose **Add Phone Number**.

**2. Choose the provider and enter credentials**

Select your provider, enter the number with its country code (for example `+12125551234`) and the credentials from the table above, then click **Save**.

**3. Assign an outbound agent**

Click **Assign Outbound Agent**, select the voice agent or voice blaster that should make calls from this number, and click **Connect Agent**.

**4. Assign an inbound agent (optional)**

To have weya answer calls to this number, assign an inbound agent to it as well.

> [!TIP]
>
> The number now appears in your list with its agents. Add it to a campaign as a calling number to start using it.

## How numbers, agents and campaigns connect

* A campaign doesn't choose an agent directly. It chooses **calling numbers**, and each call is handled by the outbound agent assigned to the number it is made from. To change which agent a campaign uses, change the number's outbound agent.
* A campaign can use several calling numbers.
* A number can be the active number of only one inbound campaign at a time. Adding it to another inbound or mixed campaign asks you to move it.
* Each number can be added once per user. Adding the same number again fails.

> [!WARNING]
>
> Your provider account limits how many calls it accepts at once. If several weya campaigns share one provider account, their calls share that limit too. When the provider turns calls away, weya pauses dialling on that account briefly and tries again, which slows campaigns down. Ask your provider for enough capacity for all campaigns that use the account.

## Add a number with the API

Use [Add Phone Number](https://docs.weya.ai/api-reference/Calling%20Management/addPhone) with the same provider and credentials, and [Get Phone Numbers](https://docs.weya.ai/api-reference/PhoneNumbers/getPhoneNumbers.md) to find a number's `_id` for campaigns.

```bash theme={null}
curl --location 'https://api.weya.live/backend/api/call/add-phone' \
  --header "x-api-key: $WEYA_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "userId": "YOUR_USER_ID",
    "phoneNumber": "12125551234",
    "integration": "twilio",
    "accSId": "YOUR_ACCOUNT_SID",
    "authToken": "YOUR_AUTH_TOKEN"
  }'
```

## Troubleshooting

> [accordion] The number won't save
>
> Check that the credentials belong to the provider account that owns the number, and that the number isn't already in your list.

> [accordion] Campaign calls stay pending
>
> Check that the number has an outbound agent assigned, and that the campaign is inside its calling days and hours. See [when calls are placed](https://docs.weya.ai/get-started/concepts.md#when-calls-are-placed).

> [accordion] Calls aren't being transferred
>
> The transfer number must be reachable from your provider account. See [Call transfer](https://docs.weya.ai/tools/calltransfer.md).

## Next steps

> [card] [Create a campaign](https://docs.weya.ai/campaigns/createcampaign.md)
>
> Use the number to call a list of contacts.

> [card] [Phone numbers API](https://docs.weya.ai/api-reference/PhoneNumbers/getPhoneNumbers.md)
>
> List, update and delete numbers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.