Animesh
Animesh

Reputation: 1757

Can I use a subaccount's number when making outgoing calls in Twilo

I am using Twilio, with a master account m and a subaccount s. I would like to make an outgoing call using the master account's credentials c_m, but using the number registered with s as my from_number. I assume that since m is the master of s, it would be possible, but that does not seem to be the case.

Have any of you faced a similar situation? Please advise.

Upvotes: 0

Views: 355

Answers (1)

Megan Speir
Megan Speir

Reputation: 3811

Animesh, I'm Megan from Twilio.

You can use your master Twilio Account credentials (AccountSid and AuthToken) to access Twilio's REST API for your master account as well as any of your subaccounts.

This would include making an outbound API call, which you can see some examples of at the bottom of this page.

The trick is to use the subaccount resource in the URI, but the master credentials in the POST body.

People run into this error all the time by using the master account sid for both the credentials and the URI. The error you'll likely get in this case is “number x is not a valid ‘from’ number associated with account y”.

Hope this helps!

Upvotes: 1

Related Questions