# API keys

> Personal keys that let your scripts reach tiko as you.

An API key lets a script reach tiko as you, without your password. It sees what you see on your boards, and nothing more.

## Make a key

1. Open **Settings → API keys** and press **New key**.
2. Give it a name you will recognise later, such as the laptop or the script it is for.
3. Choose what it may do: read, read and write, or full access when your admin allows it.
4. Choose the boards it reaches: all of yours, or only the ones you tick.
5. Choose how long it lives: 7, 30, 90 or 365 days. No key lives forever.
6. Enter your password and copy the key. tiko shows it once and keeps only a fingerprint of it, so nobody can read it back, you included.

What a key reaches:

- **Writing:** a key that writes can add to the boards you can edit, lay them out, rename them and restyle what is on them. It never changes the words of, or removes, what people made.
- **Full access:** a key with full access does on the boards you can edit what you can do yourself: it renames frames, fixes the words of notes and removes anything. Before it changes people's work, tiko saves a copy of the board, and the board can go back to that copy. An admin turns this on in **Settings → Sharing**; until then such a key only writes.
- **Chosen boards:** a key for chosen boards never sees the others.
- **Planning:** a key also reads the Planning of the workspace: its people, their teams and days away, and stage types. A key for chosen boards reads only the people and types those boards plan with.

> **Caution: What the key reads leaves tiko**
>
> Whatever the key reads leaves tiko through the program that holds it. Give it only to software you trust with those boards.

## Use a key

Send it in the `Authorization` header to the API under `/api/v1/`:

```bash
curl -H "Authorization: Bearer tiko_…" https://tiko.example.com/api/v1/me
```

`/api/v1/me` answers with your name, your workspace and what the key may do; see [Get Me](https://docs.tiko.run/reference/operations/get-me/) in the reference. What else the API reads is in [API](https://docs.tiko.run/api/), and every call is in the [API reference](https://docs.tiko.run/reference/).

The API takes keys only, never the browser's sign-in, and a key opens nothing outside `/api/v1/`.

## When a key stops working

A key stops when:

- you revoke it in **Settings → API keys**, or it expires;
- you press **Sign out everywhere** in **Settings → Security**, or reset your password with a reset link;
- an admin disables your account or removes you from the workspace.

Changing your password yourself keeps your keys; tiko tells you how many stay active. Another tiko process may take up to 30 seconds to notice a revoked key.

The API answers a stopped key with `401` and says why:

| Code | Means |
|---|---|
| `token_revoked` | The key was revoked |
| `token_expired` | The key expired |
| `auth_required` | tiko does not know the key |

## For admins

API keys can be switched on and off in **Settings → Workspace → Sharing**. A new tiko starts with them on; a tiko updated from an earlier version starts with them off, so you decide whether people may send boards to other programs.

- **While they are off,** nobody can make a key and every key answers `403 api_disabled`. Switching them on again brings the keys back.
- **The switch** shows how many keys are in use. Admins never see the keys themselves.
- **No extra reach:** a key gives an admin no more than any member: only boards they own, were shared, or that are shared with everyone.
