Creating Subprojects

Each of your SignalWire projects can own one or more subprojects. Subprojects are a way for you to have more control over the resources (e.g., phone numbers or tokens) assigned to your own customer, by separating them into different containers which you can control programmatically via our APIs.

You can select a project or subproject from the UI of your [SignalWire Space](https://signalwire.com/signin). In this example, the "Main Project" owns two subprojects.You can select a project or subproject from the UI of your [SignalWire Space](https://signalwire.com/signin). In this example, the "Main Project" owns two subprojects.

You can select a project or subproject from the UI of your SignalWire Space. In this example, the "Main Project" owns two subprojects.

All subprojects will share the same balance of your main account. However, any rooms, recordings, phone numbers, SIP endpoints, and so on, will only be visible from their own subproject.

If you delete a subproject, all and only the resources belonging to that subproject are removed.

Creating a subproject from the UI

Login to your SignalWire Space. From the left menu, click on "Dashboard". Then, select the "Subprojects" tab. You will now be able to create subprojects for the project you're currently in.

Creating a subproject using the REST APIs

The main power of subprojects comes from the ability of automation. For example, you can create a subproject using the REST APIs as in the following example:

curl -X POST https://$SIGNALWIRE_SPACE.signalwire.com/api/laml/2010-04-01/Accounts.json \
    --data-urlencode "FriendlyName=MyFirstSubproject" \
    -u $SIGNALWIRE_PROJECT_ID:$SIGNALWIRE_API_TOKEN
const axios = require('axios');
const url = require('url');

const params = new url.URLSearchParams({ FriendlyName: 'MyFirstSubproject' });
axios.post(
  "https://SIGNALWIRE_SPACE.signalwire.com/api/laml/2010-04-01/Accounts.json",
  params.toString(),
  {
    auth: {
      username: 'SIGNALWIRE_PROJECT_ID',
      password: 'SIGNALWIRE_API_TOKEN'
    }
  }
)

If successful, the reply from the server will include information about the subproject that has just been created:

{
  sid: 'c42ea358-...4bc3',
  friendly_name: 'MyFirstSubproject',
  status: 'active',
  auth_token: 'redacted',
  date_created: 'Tue, 11 Jan 2022 11:45:53 +0000',
  date_updated: 'Tue, 11 Jan 2022 11:45:53 +0000',
  type: 'Full',
  owner_account_sid: '7bfc11e6-...4eee',
  uri: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3',
  subresource_uris: {
    addresses: null,
    available_phone_numbers: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/AvailablePhoneNumbers',
    applications: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Applications',
    authorized_connect_apps: null,
    calls: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Calls',
    conferences: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Conferences',
    connect_apps: null,
    incoming_phone_numbers: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/IncomingPhoneNumbers',
    keys: null,
    notifications: null,
    outgoing_caller_ids: null,
    queues: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Queues',
    recordings: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Recordings',
    sandbox: null,
    signing_keys: null,
    sip: null,
    short_codes: null,
    messages: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Messages',
    transcriptions: '/api/laml/2010-04-01/Accounts/c42ea358-...4bc3/Transcriptions',
    usage: null
  }
}

You can do much more through the REST APIs. For example, you can list subprojects or exchange phone numbers between them. Find more by exploring our REST API Reference.


Did this page help you?