# API keys and scopes

> Create a key for a tool or your own code, give it only the access it needs, send it with each request, and revoke it in one click.

An API key lets Zapier, Make, n8n, an AI assistant or your own code act for you, with only the access you give it. Every key is shown **once**, stored only as a hash, and can be revoked at any moment.

## Create a key {#create}

1. Open the app's **Integrations** page: the account menu in Nehenoi, Techauka and Zanemotau, the console menu in Ñomongeta.
2. Under **API keys**, choose **Create key**.
3. Give it a name that says where it's used, like *Zapier: lead sheet*. You'll recognise it later in the list.
4. Pick its **Access**:
   - **Full access**: Read events, take actions and set up triggers. What Zapier, Make and n8n need.
   - **Read only**: Read events and lists. It can't change anything or set up triggers.
   - **Choose**: pick the [scopes](#scopes) one by one.
5. Pick when it **Expires**: never, or in 30, 90 or 365 days.
6. Copy the key. It's the only time it's shown; the page then keeps only its start and end (`zl_live_AbCd…WxYz`) to tell keys apart.

*Creating a key: a name, its access and when it expires.*

> [!CAUTION]
> Treat a key like a password: keep it in your tool's connection settings or a secrets manager, never in a page's code, a repository or a chat. If one leaks, revoke it and create another.

The list shows, for every key, its access, when it was last used (and by what software), when it expires and how many triggers it subscribed.


## Personal and workspace keys {#workspace-keys}

| | Personal key | Workspace key |
| --- | --- | --- |
| Created on | the Integrations page of Nehenoi, Techauka or Zanemotau | a Ñomongeta workspace's Integrations page (owners and admins) |
| Acts in | Nehenoi, Techauka and Zanemotau, as you | that workspace only, as the admin who created it, with their role |
| Who sees it | you | every owner and admin of the workspace |

A workspace key is **paused** (`401 creator_not_admin`) when the admin who created it stops being one. Using a key in the wrong kind of app answers `403 wrong_owner`.

## Send it {#send}

Send the key with every request, in the `Authorization` header (or in `X-Api-Key`, for tools that can't set that one):

```bash
curl https://www.zenhalab.com/api/integrations/v1/me \
  -H "Authorization: Bearer $API_KEY"
```

`GET /me` is the connection test: it answers who the key acts as, its scopes and the apps it can reach. A key that's wrong, revoked or expired is always refused, even if you're signed in in the same browser.

Keys start with `zl_live_` and end in a checksum, so a mistyped key is refused at once, and secret scanners can recognise one pushed to a repository by its prefix.

## Scopes {#scopes}

A scope is one permission. Reading an app's events and lists needs its `:read` scope; changing something needs `:write`; subscribing triggers needs `webhooks:write` plus the read scope of the events' app.

| Scope | Allows | Keys of |
| --- | --- | --- |
| `nehenoi:read` | Invitations and their events: RSVPs, guests, check-ins, gifts, photos. | A person |
| `nehenoi:write` | Create invitations and add guests. | A person |
| `techauka:read` | QR codes, their scans and other events. | A person |
| `techauka:write` | Create QR codes and change where they lead. | A person |
| `zanemotau:read` | Dedications' events: created, published, quiz and questionnaire answers. | A person |
| `nomongeta:read` | Conversations, messages, handoffs, flow runs and contacts as they happen; flows, agents and templates. | A workspace |
| `nomongeta:write` | Add or update contacts, send messages, start flows, add knowledge documents. | A workspace |
| `webhooks:write` | Subscribe to events (REST hooks), as Zapier, Make and n8n do. | Both |

A request without the scope it needs answers `403 insufficient_scope`, naming the scope in the body and in the `WWW-Authenticate` header.

## Limits and errors {#errors}

Each key can make **120 requests a minute**. Every answer carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`; past the limit you get `429` with `Retry-After` (seconds).

| Status | `error` | What to do |
| --- | --- | --- |
| `401` | `unauthorized` | Send the key in `Authorization: Bearer …`. |
| `401` | `invalid_key`, `revoked_key`, `expired_key` | Create a new key and update your tool. |
| `401` | `creator_not_admin` | A workspace key whose creator is no longer an admin: create a new one. |
| `403` | `insufficient_scope` | Create a key with the scope in the answer. |
| `403` | `wrong_owner` | A personal key in a workspace's app, or the other way round. |
| `404` | `not_found` | Not there, or not yours: ids of other accounts and workspaces always answer this. |
| `429` | `rate_limited` | Wait the seconds in `Retry-After`. |
| `503` | `api_disabled` | The API is paused for maintenance. Try again later. |

## Revoke a key {#revoke}

Choose **Revoke** next to it. It stops working at once, and the **triggers it subscribed are removed** with it (the confirmation says how many). Revoked keys stay listed, folded, for 90 days.

You can have up to **10 active keys**. Revoke the ones you no longer use.

## Signing in instead of a key (OAuth) {#oauth}

Some tools connect by signing in with your account instead of a pasted key: you see a consent page naming the tool and what it asks to do, and choose **Allow**. Only apps we registered can ask, and they get only the scopes you allowed. AI assistants that register themselves are marked *Unverified app* on that page; see [AI assistants](https://www.zenhalab.com/www/zenhalab/en/developers/integrations/ai-assistants#oauth).

To disconnect a tool, revoke it under **Connected apps** on your account page: its access ends and its triggers are removed.
