Skip to main content

zeroheight API: Authentication token creation

Vinh
Vinh
  • Updated

Every request to the zeroheight API needs an authentication token. A token carries a set of scopes that say what it can do: read pages, export tokens, create and edit pages, and so on. This article covers creating one. For which scopes each integration needs, see Authentication tokens: choosing a use case.

Before you get started

  • Authentication tokens belong to your team, making it easier to monitor token activity, manage creation, and revoke tokens as needed.
  • A token acts as the person who created it, or who last updated it, with that person's permissions at the time of each request. This matters for tokens that write: to create or edit pages, that person must be an editor or admin on the styleguide. If they become a viewer or lose access, the token's write requests stop working.
  • While the Client ID can be shared, the Access Token should be treated with the same care as a password. If both your Client ID and Access Token are exposed, they could be exploited to access or modify your content on zeroheight. If you suspect a leak, revoke the token immediately.
  • You can create and manage as many authentication tokens as needed, as often as necessary. Creating a separate token per integration means you can revoke one without breaking the others.

Token creation

To create a new authentication token, navigate to the Developers section in your organization's or workspace's settings and choose Create token. You'll need to provide the following details:

  • Token name: A descriptive name to help you easily identify the token, for example the integration it's for.
  • Use case: Choose pre-defined scopes tailored to your intended purpose. Pick Editor API for anything that creates or edits pages, Storybook addon or Style Dictionary exports for those integrations, and Custom to pick scopes yourself. See the "Token use cases" section below.
  • Granular token scopes: Pick specific scopes for precise control over access levels and use case (available to Enterprise customers only). Only grant what the integration actually calls.

The create token form, showing the token name, use case dropdown and scope checkboxes

Once created, take note of your Client ID and Access Token:

  • The Access Token will only be displayed once, so make sure to save it securely.
  • The Client ID will remain accessible in your organization's or workspace's settings.

The token created screen, showing the client ID and the access token to copy

Both are sent as headers on every request, along with Content-Type: application/json. The Getting started page in the API docs has a working example.

Token use cases

Selecting a use case preselects the scopes that feature needs, so you don't have to pick them by hand. Each option is covered in Authentication tokens: choosing a use case, including which plan it's available on and where to find the setup guide.

The dropdown only shows the use cases your plan includes. Editor API also needs write access switched on under Your organization → Model Context Protocol (MCP), which is on by default.

Managing tokens

  • Refresh a token to get a new access token with the same scopes, for example when rotating credentials. The old access token stops working.
  • Revoke a token to stop it working for good. Scopes can't be changed on an existing token: create a new one and revoke the old.
  • Updating or refreshing a token makes it act as you from then on, so a token that writes pages needs refreshing by someone who is an editor or admin on the styleguides it writes to.
Share this article
Was this article helpful?