How do I access Mothership's API tokens?
How do I request API access?
API access isn't on by default — it has to be enabled for your organization first. The steps are the same for new and existing customers:
- Have a Mothership account. You must already be signed up as a Mothership user. (Not yet? Sign up first.)
- Email your sales representative. Send a request to your sals rep with the subject line
[DEVELOPER ACCESS] - <your company name>. - We then review your request and, if approved, enable access and generate your tokens. Once access is turned on, you'll be able to authenticate and start using the API.
A sandbox environment is available to test endpoint response shapes. Responses are mocked and no data is saved. Full API documentation is at developers.mothership.com.
Once access is enabled, here's how to view your API tokens:
API tokens are essential for accessing and utilizing Mothership's API, serving as secure identifiers that authenticate users and allow interaction with the platform's functionalities. Once API access has been enabled for your organization, only users with "Owner" permissions will have the capability to directly view API tokens through the dashboard. This security measure is intentionally implemented to safeguard your organization's information.
Viewing API Tokens
-
Start by logging into your Mothership dashboard using your credentials.
-
In the lower left-hand corner, near your user information, you'll find the Settings section. Click on it to proceed.
-
Within the Settings, look for the 'API' tab. Click on it to access a comprehensive view of both sandbox and production API tokens associated with your organization.
.png?width=670&height=379&name=image%20(43).png)
Differentiating Sandbox and Production Tokens
Sandbox and production tokens are different and are clearly labeled by prefix. Production tokens begin with sk_live_, while sandbox tokens begin with sk_test_. Make sure you use the token that matches the environment you intend to call.
Copying API Tokens
To use an API token, click on the token you wish to copy. This will open a detailed view. A 'Copy' button will appear within the detailed view. Click on it to quickly copy the token to your clipboard
Revoking API tokens
If an API token is no longer needed, or you think it may have been exposed, you can revoke it from the dashboard at any time.
Revoking an API Token
- Log in to your Mothership dashboard.
- Open Settings from the lower-left corner.
- Select the API tab.
- In either the Live or Sandbox section, find the token you want to remove.
- Click Revoke token.
- In the confirmation modal, click Revoke token again to confirm.
Once revoked, the token stops working immediately and can no longer be used to authenticate API requests.
Before you revoke a token
- Make sure any applications or integrations using that token are updated first.
- If you still need access, create a new token before revoking the old one.
- Mothership supports up to two active tokens per environment, so you can rotate tokens with minimal downtime.