How to Access AudioStack by Assuming a Different Organisation
Access content and functionality from an organisation other than your primary one
Introduction
With AudioStack, it's possible for users have access to multiple organisations. The organisation model allows an organisation's admins and owners to manage user roles and permissions, granting or restricting access to specific features and content. Learn how to assume an organisation when working with the AudioStack API, using Python and JavaScript SDKs, as well as making direct API requests.
Assuming Roles
In order to access an organisation, you'll first need to be given access to the organisation by the admin or owner, using the AudioStack Platform. Your account will be granted membership of the organisation, but your primary organisation will remain the one you first registered with.
So, once you've been granted access, to use the API as a user in a different organisation from your main organisation you'll need to tell AudioStack you'd like to assume that organisation. Here's how you can do that using our Python SDK:
import audiostack
import os
audiostack.api_key = os.environ["APIKEY"]
audiostack.assume_org_id = "ORGANISATION_ID"
In Javascript, simply add this line in addition to defining the apiKey as usual:
const AS = new Audiostack(apiKey, { assumeOrg: 'ORGANISATION_ID' });
In both of these code examples you'll need to replace the ORGANISATION_ID and APIKEY - this will let you assume the role of the secondary organisation.
You can use organisations to separate private data and keep it secure.
For example, if you're an agency you may want your individual brand customers to all be in separate child orgs.
Updated 6 months ago