API tokens
Create revocable bearer tokens for scripts and automation.
Create a token
- Open API tokens in the 1sc dashboard.
- Under Create token, choose the token settings.
- Click Create token.
- In Setup, click Copy env and paste the exported variables into the terminal session that will use the token.
| Field | Required | Default / options | Purpose |
|---|---|---|---|
| Label | Required | Any label that identifies the script or agent | Helps you recognize the token before revoking it. |
| Access | Required | Read only for monitoring; Operator for deployments and attach actions | Controls which API actions the token can perform. |
| Expiration | Required | 1 day, 7 days, 30 days, or Never, revoke manually | Limits token lifetime. |
Make your first request
terminal
curl --fail-with-body "$ONE_SC_API_URL/api/v1/deployments" \
--header "Authorization: Bearer $ONE_SC_API_TOKEN"A successful request returns your deployments. A missing, expired, revoked, or insufficiently scoped token returns an error with a stable code and descriptive message.
Scope bundles
| Bundle | Scopes |
|---|---|
| Read only | deployments:read, deployments:logs |
| Operator | deployments:read, deployments:create, deployments:logs, deployments:stop, deployments:resume, radio-attach:run |
| TUI | deployments:read, deployments:create, deployments:logs, deployments:stop, deployments:resume, radio-attach:run |
Revoke a token
- Open API tokens in the 1sc dashboard.
- Find the token under Active tokens.
- Confirm the label, scopes, expiration, and last-used date identify the token you want to remove.
- Click Revoke.
Use Read only for monitoring. Grant Operator only when automation must create, stop, or resume deployments or run attach validation. Revoke tokens when the automation is retired or the token may have been exposed.