# Workspace API token

A Workspace API token allows Workspace members to access the [Bitrise API](/bitrise-ci/api/api-overview) without each member having to set up their own [Personal Access Token](/bitrise-platform/accounts/personal-access-tokens). For API authentication, the Workspace token functions the exact same way as the Personal Access Token. You can also use it to log in with the [Bitrise CLI](/bitrise-ci/bitrise-cli/authenticating-with-the-bitrise-cli).

Workspace owners, Workspace managers, and members with a custom role that includes **Manage API access** can set up multiple Workspace API tokens, each with different access rights to the apps owned by the Workspace. The access rights are determined by [user roles](/bitrise-platform/projects/roles-and-permissions-for-bitrise-ci), just as it is for [Workspace members](/bitrise-platform/workspaces/collaboration-and-permissions-in-workspaces/workspace-collaboration) or [Workspace groups](/bitrise-platform/workspaces/collaboration-and-permissions-in-workspaces/workspace-groups).

We recommend setting up any integrations that require an access token for API access using a Workspace API token instead of individual users' Personal Access Token.

## Creating a Workspace API token

1. 1. Log in to Bitrise and hover over the left navigation bar.
1. Make sure you have the right workspace selected in the **Workspace** menu.
1. Select **Settings**.
1. On the left, select **Security**.
1. Click **Create token**.

   ![workspace-api-token.svg](/img/_paligo/uuid-cb123ebc-f548-8e87-615f-aab39fefa078.svg)
1. On the **Settings** step, enter a **Name** and select an **Expiration** for the token.
1. Select a **Workspace role** for the token. This determines what the token can do at the workspace level.
1. Leave **Notify workspace owners before this token expires** checked to have Bitrise email the Workspace owners before the token expires, or clear it if you don't want that. See [Expiry notification emails](#expiry-notification-emails).
1. Click **Next**.
1. On the **Product access** step, set up what the token can access:

   - Toggle on **Admin access** to let the token manage all aspects of selected projects, with access to all products.
   - Toggle on **Bitrise CI** to let the token access CI builds. Choose **Apply to: All projects** or **Selected projects**, then select a **Role** — or leave it on **No access**.
   - Toggle on **Release Management** to let the token access Release Management, with permissions controlled by role at the app level.
   - Toggle on **Remote Dev Environments** to let the token act on Remote Dev Environments for the workspace, for example to mint [device preview links](/bitrise-rde/devices/device-preview-links) from CI. Sessions the token creates are owned by the workspace.
1. Click **Create token**.
1. Click **Copy and close** to copy the token and close the dialog box.

   :::caution[Save the token]

   Once you closed the dialog box, you won't be able to see the token again!

   :::

## Expiry notification emails

When you create a Workspace API token, **Notify workspace owners before this token expires** is checked by default. Bitrise then emails every owner of the Workspace before the token expires so you can regenerate it or create a new one before your integrations and scripts stop working. When the email arrives depends on the expiration you chose:

- **6 months** or **3 months**: 30 days and 7 days before the token expires.
- **1 month** or **2 weeks**: 7 days before the token expires.

You can't turn on notifications for tokens that never expire or that expire in less than 7 days, such as **1 day** or **1 hour**. The setting stays with the token when you regenerate it, even if you choose a different expiration. You can't change it for an existing token: to turn notifications on or off, create a new token.

For example, you create a token that never expires. Because notifications aren't available for it, the setting is off. Later you regenerate the token with an expiration of **6 months**, which would normally send notices. The token still doesn't send them, because regenerating doesn't change the setting. To get notifications for this token, create a new one.

## Regenerating a Workspace API token

If a Workspace API token is lost for any reason, there is no way to view it again. You have the option of regenerating the existing token: this way you don't have to create an entirely new token and configure app access again. The regenerated token will:

- Have a new expiration date.
- Have access to the exact same apps with the exact same roles as before.
- Keep its expiry notification setting.

1. 1. Log in to Bitrise and hover over the left navigation bar.
1. Make sure you have the right workspace selected in the **Workspace** menu.
1. Select **Settings**.
1. On the left, select **Security**.
1. Find your token and click the options menu (⋮) next to its name.
1. Select **Regenerate**.

   ![regenerate-token.png](/img/_paligo/uuid-3850ebd0-6ab7-934f-c232-4305ccffe249.png)
1. Select the new expiration date.
1. Click **Regenerate** to get the new token.
1. Click **Copy and close**.

   Make sure to save the token in a secure way: you won't be able to see it again.
