Skip to main content

Getting Started

Loading...

[[ rootSection.name === "Studio" ? "InVision Studio" : rootSection.name ]]

Using the Design Tokens API

This article applies specifically to the new DSM. If using legacy DSM, check out this article instead.

The DSM Tokens API provides programmatic access to your tokens. It allows you to download a ZIP file that includes the entire folder tree, where each token set is available as a JSON file.

To help you get started, we created this example script that uses the the DSM Tokens API and Style Dictionary to create style files for different platforms.

Accessing the API endpoint

To access the API endpoint for tokens:

  1. Open your DSM design system and navigate to the Tokens page.
  2. Next to the Tokens heading in the left-hand navigation, click the action menu.
  3. Click API setup.
  4. Copy the API endpoint for your design system's tokens.

Generating authentication keys

Using the design tokens API requires an authentication key. To generate an authentication key, click Manage in the Manage authentication keys panel of the API setup page.

  1. Open your DSM design system and navigate to the Tokens page.
  2. Next to the Tokens heading in the left-hand navigation, click the action menu.
  3. Click API setup.
  4. In the API Authentication section, click Manage.
  5. Click Generate new key.
  6. Copy the Key ID, add an optional Description, and click Save.

Revoking authentication keys

To revoke an existing authentication key:

  1. Open your DSM design system and navigate to the Tokens page.
  2. Next to the Tokens heading in the left-hand navigation, click the action menu.
  3. Click API setup.
  4. In the API Authentication section, click Manage.
  5. Next to the appropriate key, click Revoke.
  6. To confirm, click Revoke again.

Accessing endpoints for specific versions

To access the API endpoint for a specific version of your design system, first switch to the appropriate version using the version drop-down at the top of the DSM documentation site.

After doing so, follow the previously mentioned steps for accessing the API endpoint.

API permissions

Viewers, editors, and admins of a design system can download tokens and use the API.

Only editors and admins can generate and revoke authentication keys. Viewers can see the first four characters of a key, who generated it, and the description. For viewers to access the API, an admin or editor will need to provide them with an authentication key directly.