API tokens
Credentials for scripts, CI and assistants. Every token has a role and can be limited to single projects.
On this page
What it is
An API token signs in something that isn't a person. That could be a CI pipeline, a deployment script or an AI assistant. The token belongs to the organization. It has its own role.
That's the point of it. A token tied to your account would stop working the day you leave. Your pipeline would stop with it. An organization token keeps working after you leave. You can revoke it without touching anyone's login.
When you'd use it
- You deploy from your own CI.
- A cron job runs
klopssomewhere. - A script or an AI assistant needs access without using your session.
Create one
- Open API tokens in the organization's sidebar and choose New token. Only owners and admins see, create and revoke tokens.
- Name it after what will use it.
github-actions-shoptells the next person what breaks if they revoke it.jan-tokendoesn't. - Pick the role. For anything that only reads, use viewer.
- If you want, limit it to specific projects. Without a limit it works for the whole organization.
- Copy the value. You only see it this once.
Using it
export KLICKOPS_SERVER=https://klickops.example.com
export KLICKOPS_TOKEN=klp_…
klops apps list --project shop -o json
For the API it's a normal 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 the token is for. It shows in the list, next to who created it. What the token does is logged under the token. |
| Role | viewer | What it may do: viewer, editor or admin. |
| Projects | all | Limits it to named projects. Empty means the whole organization. |
| Last used | never | When it last signed in. This helps you spot forgotten tokens. |
Limits and gotchas
- You see the value only once. If you lose it, create a new token.
- A token doesn't expire on its own. It works until you revoke it. That's why the last-used column matters. It shows you tokens nobody needs any more.
- Limit the role first, then the projects. Most CI pipelines need
editoron one project. Most assistants only needviewer. - A token runs workloads. Running the organization needs a person. Even an
admintoken can't do these things: invite or remove members, change the plan, 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. If they leave the organization or delete their account, the token keeps working. That keeps your CI running when your team changes. When someone leaves, check the list for their tokens. Revoke the ones nobody needs.
- Revoking works at once and for good. Anything using the token fails on the next call. The CLI exits with code
3.
Anyone can read a token that sits in a repository. Put it in your CI's secret store. If one ever gets committed, revoke it right away. Assume someone read it. Rewriting the history won't help at that point.
Related
- klops CLI reads
KLICKOPS_TOKENdirectly. - MCP server: assistants sign in there by themselves. For scripts and CI, use a token.
- Members and roles: the same question for people.