API tokens
Long-lived credentials for scripts, CI and assistants, scoped to a role and optionally to single projects.
On this page
What it is
An API token authenticates something that is not a person: a CI pipeline, a deployment script, an AI assistant. It belongs to the organization rather than to you, and it carries a role of its own.
That ownership is the point. A token tied to your account stops working the day you leave, taking the pipeline with it. An organization token survives you and can be revoked without touching anybody's login.
When you'd use it
- Deploying from your own CI.
- A cron job that runs
klopssomewhere. - Giving an AI assistant access without handing over your session.
Create one
- Open API tokens in the organization's sidebar and choose New token. Only an owner or admin sees, creates and revokes tokens.
- Name it after what will use it, not after yourself.
github-actions-shoptells the next person what breaks if they revoke it;jan-tokendoes not. - Pick the role. Viewer for anything that only reads.
- Optionally scope it to specific projects. A token without a project scope reaches the whole organization.
- Copy the value. It is shown once and never again.
Using it
export KLICKOPS_SERVER=https://klickops.example.com
export KLICKOPS_TOKEN=klp_…
klops apps list --project shop -o json
Against the API directly it is an ordinary bearer token:
curl -H "Authorization: Bearer klp_…" \
https://klickops.example.com/api/klickops/projects/shop/apps
Settings reference
| Setting | Default | What it does |
|---|---|---|
| Name | none | What this token is for. Shown in the list, next to who created it; what the token does is logged under the token, not under a person. |
| Role | viewer | What it may do: viewer, editor or admin. |
| Projects | all | Restricts it to named projects. Empty means the whole organization. |
| Last used | never | When it last authenticated, so you can tell a live token from a forgotten one. |
Limits and gotchas
- The value is shown once. Lost means rotate, not recover.
- A token does not expire on its own. It works until revoked, which is why the last-used column matters: it is how you find the ones nobody needs any more.
- Scope by role first, projects second. Most CI pipelines only need
editoron one project, and most assistants only needviewer. - A token runs workloads, not the organization. Even an
admintoken cannot invite or remove members, change the plan or request a top-up, create or revoke tokens, verify domains, redeem promo codes or approve a CLI sign-in: those need a person signed in to the browser. - It outlives the person who created it. Leaving the organization or deleting their account does not stop it; that is what keeps your CI running through staff changes. When someone leaves, check the list for the tokens they created and revoke the ones nobody needs.
- Revoking is immediate and unrecoverable. Anything using it fails on the next call, with exit code
3from the CLI.
Careful
A token in a repository is a token in everybody's hands. Put it in your CI's secret store, and if one is ever committed, revoke it rather than rewriting history: assume it was read.
Related
- klops CLI reads
KLICKOPS_TOKENdirectly. - MCP server should get a scoped token rather than your session.
- Members and roles for the same question about people.