> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# API tokens

> Create tokens limited to the actions, resources, addresses and lifetime they need. Ask-first actions wait for your approval, and Rotate keeps the old token working for 24 hours.

> [!TIP]
>
> **Live.** This area is documented as current, user-reliable behavior.

## Goal

Give code, servers and tools a token with only the access they need.

## Prerequisites

* A signed-in browser session. Tokens cannot be created from the CLI or another token.

## Workflow

**Step 1**

In team settings, open Tokens and choose New token.

**Step 2**

Give it a Name that says where it will live.

**Step 3**

Pick a Start from preset: Deploy only, Mail send only or Full access. Then adjust What it can do.

**Step 4**

Under Only for, pick the projects, databases, Mail domains, buckets, servers or Assets spaces it may use.

**Step 5**

Optionally add Only from these addresses, then choose Expires: 30 days, 90 days, 1 year or a date. 90 days is the default.

**Step 6**

Choose Create token and copy it straight into your server’s secrets. It is shown once.

## Actions that ask first

* Ask-first actions, such as sending mail or resizing a database, show Asks you first. When the token calls one, the API answers 202 with approval\_required and a status\_url, and the action runs once you approve it.
* Approve or decline in the token’s panel under Waiting for your approval.
* Turn on Run without asking for an action that must run unattended, for example in CI.

## What can this token do?

* Each token’s panel lists what it can and can’t do in plain sentences, who made it and when it ends.
* Last used, This month, Recent calls and Refused show how it is used. Calls from addresses outside its list are refused and listed.
* Edit limits narrows a token. Widening needs an Owner or Admin.
* Tokens made earlier that could do everything show as Full access. Narrow them with Edit limits.
* Owners and Admins see and can limit or delete every token owned by team members.

## Rotate and delete

* Rotate gives you a new token with the same limits and keeps the old one working for 24 hours, so you can switch your code and tools first.
* Delete stops the token at once. If a token leaked, delete it first.
* Tokens unused for 90 days appear in Unused access.
* The token’s owner gets an email 7 days and 1 day before it expires.

## From the API

Send preset or actions, plus resources, ip\_cidrs, unattended (actions that run without asking) and expires\_at. POST /api/v1/auth/tokens/\{tokenId}/rotate rotates, and GET /api/v1/auth/tokens/\{tokenId}/access describes what the token can do.

```json POST /api/v1/auth/tokens theme={null}
{
  "name": "GitHub Actions deploy",
  "preset": "deploy_only",
  "resources": ["project:8f2a…"],
  "ip_cidrs": ["41.58.0.0/16"],
  "expires_at": "2027-02-24T00:00:00Z"
}
```

## Expected result

> [!TIP]
>
> The token works for the listed actions and resources only, and its panel shows what it can do and when it was last used.

## Related guides

> [card] [Roles](https://docs.stackshift.cloud/team-and-access/roles-and-collaboration.md)
>
> Every person on a team has a role: Owner, Admin, Developer, Viewer or Billing. Developers build and deploy; once Access is switched on, they cannot delete production resources.

> [card] [Team audit log and export](https://docs.stackshift.cloud/team-and-access/audit-log.md)
>
> See everything people, tokens, agents and automations changed in a team, and everything they were refused. Export CSV or JSON, or stream it through Events.

> [card] [Security and connections](https://docs.stackshift.cloud/settings/security-and-connections.md)
>
> Manage password changes, active sessions, GitHub app installs, and other connected-account behavior from the settings area.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.