Docs
  • Our Plugins
  • Plivo - Voice - In browser calls plugin
    • Getting Started
    • Actions & Events
    • APIs
    • Change Log
  • Twilio In-browser Call Plugin
    • Getting Started
    • Making Calls
    • Receiving Calls
    • Recording a Call
    • Subaccounts
    • States
    • Change Log
  • HubSpot Plugin
  • Transfer Wise Plugin
  • Checkr Plugin
  • More Plugins
  • Plugins Support
  • Bubble Resources
    • Bubble Forum
    • Bubble Manual
Powered by GitBook
On this page
  • Twilio Subaccounts Management
  • Bubble Editor
  • Making a subaccount call
  • Receiving a subaccount incoming call
  1. Twilio In-browser Call Plugin

Subaccounts

Subaccounts possess their own resources, such as phone numbers, yet they are managed under a primary Twilio account with which they share a financial balance. This page should help you get started.

PreviousRecording a CallNextStates

Last updated 12 months ago

Twilio Subaccounts Management

Subaccounts can be created and accessed via Console, but can also be managed via the Twilio REST API. For more details, please see our article .

For each subaccount you will need the following:

  1. Subaccount Sid

  2. API key & Secret

  3. Voice Application

  4. Caller number: make sure the number uses the main account calling function

Following we will explain more how to manage your subaccounts using Twilio Console.

Create a subaccount:

To create a subaccount go to the console > subaccounts > Create

If you are using the console, make sure to switch to the subaccount before implementing the following steps

Create a subaccount API key:

Make sure you are using the subaccount console, then follow the same steps as

Create a subaccount voice application:

Make sure you are using the subaccount console, then follow the same steps as . Regarding the application voice function, you can use the main account voice function for easier maintenance. How ever you can create functions for each account, if you have a special use case.

Bubble Editor

Step1: Access token generation

Create a custom event this event then Add an action that requests a subaccount voice access token and store the value in a state

Step 2: Adding token to the client

Provide the token to the client element by referring to the token state

Step 3: Refreshing Client Tokens Before Expiration

To ensure uninterrupted service, it's crucial to refresh client tokens before they expire. Implement a token refresh mechanism by triggering a custom event, get-token, upon detecting that the current token is nearing expiration. Here's how to set up the event trigger:

  1. Detect Token Expiration: By adding the token expiring element event

  2. Trigger Custom Event: Add the get-token action. This action should request a new token and update the token state.

By following these steps, you can ensure your application maintains secure and continuous access to resources by keeping client tokens up to date.

Making a subaccount call

Receiving a subaccount incoming call

That can be implemented in two ways:

  1. Using one voice function and adding the voice function URL to all the numbers under this account

Similar to the , just make sure to use a Caller number that's registered under the subaccount.

Using Twilio Studio flow; Similar to the , just make sure to do it form the subaccount console.

View and Create New Twilio Subaccounts
create an API key
Create a voice application
making calls
receiving calls