# Manage API tokens > Create, use, rename, and revoke Orchard personal API tokens for scripts, CI jobs, and MCP clients. Source: https://docs.orchard.hackclub.com/account/tokens/ A personal API token lets a script, a CI job, or an MCP client call Orchard without a browser. The token acts as your account, so it can never do more than you can, and you can limit it further with an access level, a lifetime, and a list of projects. > **Note** > > Interactive use of the [CLI](/cli/) does not need a token. `orchard auth login` creates and stores one for you. ## Token access levels Each token has one access level. Each level includes the level before it. | Level | Allows | | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `read` | Most read requests. Some reads that return secrets require `deploy`. | | `deploy` | `read`, plus requests that create, update, delete, scale, or restart. | | `exec` | `deploy`, plus [shells in pods](/run/logs/#open-a-shell) and databases, commands inside containers, and creating or editing sandboxes. | At any access level, a token cannot register a passkey, set a password, or call instance setup and admin routes. Tokens cannot manage an organization's SSO or SCIM, or change passkeys. A token restricted to projects also cannot use account routes, such as sessions, tokens, GitHub, or invitations, apart from reading its own user. ## Tokens and single sign-on An organization that [requires single sign-on](/teams/sso/#require-single-sign-on) only accepts tokens created after signing in through its provider. Such a token works in that organization and nowhere else, and its row in the list says so. It also cannot create more tokens. A token created any other way gets a `403` with the error `org_sso_required` in that organization, and keeps working in your other organizations. To fix this, sign in through the organization's provider and create a new token at **Account settings** > **API tokens**. Owners of the organization are exempt. ## Create a token **Dashboard** 1. Go to **Account settings** > **API tokens**. 2. Select **New token**. 3. In **Name**, enter a name that describes where you use the token. 4. In **Access**, select **Read**, **Deploy**, or **Exec**. 5. Select **Create token**. 6. Copy the token. Orchard does not show it again. 7. Select **Done**. **CLI** Run the following command: ```bash orchard auth token create --name ci --scope deploy ``` The command prints the token once. Copy it before you close the terminal. | Flag | Description | | -------------- | --------------------------------------------------------------------- | | `--name` | Token name. Required. | | `--scope` | `read`, `deploy`, or `exec`. The default is `read`. | | `--expires-in` | Lifetime, such as `30d` or `12h`. The default and maximum are `90d`. | | `--project` | Restrict the token to a project ID or slug. You can repeat this flag. | A token expires after 90 days unless you set a shorter lifetime. The dashboard always uses 90 days. To set a shorter lifetime or restrict a token to specific projects, use the CLI. ## Use a token Send the token in the `Authorization` header: ```bash curl "https://orchard.example.com/apiv1/auth/me" \ --header "Authorization: Bearer " ``` To use a token with the CLI, set the `ORCHARD_API_URL` and `ORCHARD_API_TOKEN` environment variables: ```bash export ORCHARD_API_URL=https://orchard.example.com export ORCHARD_API_TOKEN= ``` To use a token with an MCP client, refer to [Connect an MCP client](/mcp/#connect-with-an-api-token). ## Rename a token 1. Go to **Account settings** > **API tokens**. 2. On the token row, select **Rename**. 3. Enter the new name. 4. Save the name. ## Revoke a token Requests that use a revoked token fail immediately. **Dashboard** 1. Go to **Account settings** > **API tokens**. 2. On the token row, select **Revoke**. 3. Select **Revoke token**. **CLI** 1. List your tokens to find the token ID: ```bash orchard auth token list ``` 2. Revoke the token: ```bash orchard auth token revoke ``` > **Caution** > > [Signing out all other devices](/account/security/#sign-out-of-a-device) also deletes every API token on your account. ## Rotate a token 1. Create a new token. 2. Update the script, job, or client to use the new token. 3. Revoke the old token. ## Related resources - [Update an app with a webhook](/run/webhooks/) - Redeploy an app from CI with a deploy webhook token instead of a personal token. - [Set up SCIM provisioning](/teams/scim/) - Sync people from your identity provider with an organization token. - [`orchard auth` reference](/reference/cli/#auth) - Every flag of the sign-in, session, and token commands.