ThoughtSpot acquires Mode to define the next generation of collaborative BI >>Learn More

API reference

API tokens

API tokens allow you to connect to Mode’s API programmatically. An API token is used instead of your email address and account password whenever you programmatically authenticate to Mode with basic authentication.

To call the API, you must first create an API access token. Currently, Mode supports three types of access tokens – Workspace API tokens, Member API tokens, and personal API tokens. Starting in June 2023, you can only create Workspace API tokens, as this is the more secure and therefore recommended way to provide API access. Admins can also enable the Member API tokens feature to allow all their nembers to create API tokens. Any personal tokens that were created prior to June 2023 can continue to be used to authenticate with the API; however, we will be fully deprecating personal API tokens on February 28, 2025.

The Workspace API tokens are meant to be used for programmatic management, such as archiving inactive Reports or deleting schedules for stale Reports across your Workspace. These tokens mimic Admin access to the Workspace and only Admins will be able to create and manage them.

The Member API tokens are meant to be used by a single user for individual use cases, such as updating a specific Report or managing a Collection. These tokens mimic the individual user's access to the resources in the Workspace.

See the full documentation for Mode's API here.

Creating an API Access token

WARNING: Remember to store your API token and password securely. Do not expose the password on public sites, in client-side code, or in public code repositories.

Workspace Tokens

Only Admins are able to create Workspace tokens. You can create as many API access tokens as you need. To create one, navigate to your Workspace Settings > Features > API Keys > Workspace keys. Click “Create API Key” and you will be prompted to add a display name and save the token.

Member Tokens

To enable the Member API tokens feature, Admins can navigate to your Workspace Settings > Features > API Keys > Member keys. Admins can see all the Member tokens created and revoke all or specific tokens on this tab. Users can then go to Workspace Settings > Personal > My API Keys to create their own API tokens.

The credentials are comprised of two parts:

  1. Token: The public component of the credential. Often referred to as the username or access key during authentication.
  2. Secret: The private component of the credential. Often referred to as the password or access secret during authentication. This is only shown once when creating the token and must be saved somewhere secure before closing the modal.

Limitations:

For more information on generating and managing Workspace and Member API tokens, see here.

Personal Tokens

IMPORTANT: You can continue to use personal API tokens with the API. However, you will not be able to generate new personal tokens. Personal token use will be deprecated on February 28, 2025.

When using personal API tokens, access to resources in the API directly matches your level of permissions in the Mode Workspace you’re calling. Before returning a response, Mode validates every API call against your permissions in that Workspace.

FAQs

Q: Mode API Rate Limiting

As of today, our API rate limiting is approximately 40 requests every 10 seconds, or 4 requests per second per username. We currently publish two headers:

  • X-RateLimit-Limit, which shows the total number of requests allowed for that class of resources.
  • X-RateLimit-Remaining, which shows how many requests until you'll be throttled.

Q: How to check which reports are scheduled and viewed

API Method

You can loop through every single report in the workspace (the ones in public/private collections, but not other members' personal collections), and check each individual report to see whether it's scheduled. The API documentation on how to get all the reports in your workspace is here.

From there you can see the view_count property which will allow you to see the view count for an individual report.

Discovery Database Method

You can also use the Discovery Database to obtain the same information for their reporting. The documentation for the Discovery Database can be found here.

Was this article helpful?

Get more from your data

Your team can be up and running in 30 minutes or less.