---
title: "Access tokens"
description: "Create and rotate scoped personal or service-user API access tokens for CI pipelines, scripts, and external MCP clients."
url: "https://www.thecompany.company/docs/organization/access-tokens"
---

# Access tokens

> Create and rotate scoped personal or service-user API access tokens for CI pipelines, scripts, and external MCP clients.

Access tokens authenticate API and MCP proxy requests against a single organization. Use a **personal access token** when requests should act as you, and a **service-user token** for CI jobs or shared automations so requests run under a dedicated identity rather than a teammate's account.

| Token type | Acting identity | Where to create it |
| --- | --- | --- |
| **Personal access token** | Your account in the active organization. | **Settings → Access tokens** |
| **Service-user access token** | The named service user (not the admin who issued the token). | **Settings → Service users** (Owner or Admin) |

## Create a personal access token [#create-a-personal-access-token]

1. ### Open Access tokens [#open-access-tokens]

   Switch to the target organization, open **Settings → Access tokens**, and select **New access token**.
2. ### Name and scope the token [#name-and-scope-the-token]

   Enter a descriptive **Name**, turn on **Restrict scopes** under **Permissions**, and select only the scopes the client needs. Leaving **Restrict scopes** off grants whatever your identity can already do—never beyond your role or resource access.
3. ### Set expiration and copy once [#set-expiration-and-copy-once]

   Choose an **Expiration**, select **Create**, and click **Copy access token** immediately to store it in your password manager or secret store. The full token cannot be viewed again after closing the dialog.

## Create a service user and token [#create-a-service-user-and-token]

1. ### Create the service user [#create-the-service-user]

   As an Owner or Admin, open **Settings → Service users**, select **New service user**, enter a name such as `Release CI`, and select **Create**. New service users start with the **Member** role.
2. ### Issue a scoped token [#issue-a-scoped-token]

   Open the service user's row menu, select **API tokens → New token**, configure **Name**, **Permissions**, and **Expiration**, select **Create**, and save the token in your CI secret store.

> Review our proposed CI job and list every API request it makes along with the minimum token scopes required. Don't create a token or edit the workflow.

## Authenticate and rotate tokens [#authenticate-and-rotate-tokens]

Send tokens in the `Authorization` header, reading them from a secret store or environment variable rather than committing them to code. Use one token per client or job so revoking one never disrupts others.

```bash
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $TCC_API_TOKEN" \
  https://api.thecompany.company/v1/environments
```

- **Planned rotation:** Create a replacement token with the same identity and minimal scopes, update your client or CI secret, verify a real request succeeds, and then **Delete** the old token. Editing a personal token updates its name or scopes without issuing a new secret.
- **Leaked token:** Delete the compromised token immediately first, then issue a replacement.

> Find which CI jobs reference `TCC_API_TOKEN` without reading or printing its value. Tell me which secret to update and which job will verify the replacement before I delete the old token.

If an authenticated request returns `403`, check both the token's scopes and the acting identity's [organization role and resource permissions](/docs/organization/members).

To add or revoke a sharing grant with a scoped token, include `acl:write` and the resource type's write scope, such as `artifacts:write` or `secrets:write`. On a single or bulk revocation, a missing resource write scope returns the same `404` as a missing or inaccessible grant. If you expected the grant to be revocable, check both scopes and resource permissions.

## Next steps [#next-steps]

- [App API](https://www.thecompany.company/docs/api.md): Start sessions, stream progress, and integrate via the REST API.
- [MCP servers](https://www.thecompany.company/docs/customize/mcp.md): Authenticate external MCP clients using a scoped token.
- [Secrets](https://www.thecompany.company/docs/code/secrets.md): Store third-party tokens for code running inside cloud computers.
- [Enterprise](https://www.thecompany.company/docs/organization/enterprise.md): Use service users to govern shared CI and automation identities.
