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 two types of access tokens – Workspace 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. 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 in August 2024.

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.

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 > Default Settings > API. Click the “gear” icon and select “Create new API token.” You will be prompted to add a display name and save the token.

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:

  • Workspace API tokens cannot be used for creating new invites
  • Granular permissions are not currently supported with the Workspace API tokens; they allow admin access to the Workspace for now.

For more information on generating and managing Workspace 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 in August 2024.

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.