Appearance
Adding tokens on demand
The token management API lets you create plugin API tokens, delete them, and change which domains each token is allowed to run on, without opening the dashboard.
This is aimed at multi-tenant setups. On a CRM platform where each customer runs on their own subdomain, a new customer's subdomain (newcustomer.yourcrm.com) can be added to an existing token as they sign up, and a departing customer's token can be deleted to revoke access.
How it works
1. Get an API key
These endpoints authenticate with an API key from your account settings. Open Settings, go to API Tokens, select "Create API Token", and grant the token the permissions it needs. A token carries any of four permissions, read, create, update, and delete, and each endpoint checks the matching one.
2. Set the request headers
Every request carries these two headers:
json
{
"accept": "application/json",
"Authorization": "Bearer <api-key>"
}Servers
https://app.topol.io/apiProduction server
Get a list of API tokens
GET
/api-tokens
Retrieve a list of API tokens
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Responses
API tokens fetched successfully
application/json
{
}
Create a new API token
POST
/api-tokens
Create a new API token
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Request Body
application/json
{
}
Responses
API token created successfully
application/json
{
}
Get an API token
GET
/api-tokens/{apiTokenId}
Get an existing API token
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Parameters
Path Parameters
apiTokenId*
API token ID
Type
Requiredstring
Responses
API token retrieved successfully
application/json
{
}
Delete an API token
DELETE
/api-tokens/{apiTokenId}
Delete an existing API token
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Parameters
Path Parameters
apiTokenId*
API token ID
Type
Requiredstring
Responses
API token deleted successfully
application/json
{
}
Add domains to an API token
POST
/api-tokens/{apiTokenId}/add-domains
Add domains to an existing API token
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Parameters
Path Parameters
apiTokenId*
API token ID
Type
Requiredstring
Request Body
application/json
{
}
Responses
API token deleted successfully
application/json
{
}
Remove domains from an API token
POST
/api-tokens/{apiTokenId}/delete-domains
Remove domains from an existing API token
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Parameters
Path Parameters
apiTokenId*
API token ID
Type
Requiredstring
Request Body
application/json
{
}
Responses
API token updated successfully
application/json
{
}
Update storage settings for an API token
PUT
/api-tokens/{apiTokenId}/storage
Update storage settings for an existing API token
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Parameters
Path Parameters
apiTokenId*
API token ID
Type
Requiredstring
Request Body
application/json
{
}
Responses
API token storage updated successfully
application/json
{
}
Delete an API token storage settings
DELETE
/api-tokens/{apiTokenId}/storage
Delete an existing API token storage settings
Authorizations
BearerAuth
Use: Authorization: Bearer <api-key>
Type
HTTP (bearer)
Parameters
Path Parameters
apiTokenId*
API token ID
Type
Requiredstring
Responses
API token storage deleted successfully
application/json
{
}