List keys
GET /api/api-keys
- Auth – signed-in, email-verified user.
- Response – array of key views:
lastUsedAt updates automatically whenever the key authenticates a request.
Create a key
PUT /api/api-keys
- Body
accessType values:
-
full– inherits the owner’s permissions. Do not includeprojectIdsorpermissions. -
projects– requireprojectIds(IDs or slugs you already have access to). -
custom– requirepermissions(permission strings such asmarketing.pipelines.read). - Response
secret immediately; the API will never return it again.
Retrieve / update / delete
| Endpoint | Body | Notes |
|---|---|---|
GET /api/api-keys/{id} | — | Returns the same view as the list call. |
PATCH /api/api-keys/{id} | Any combination of name, accessType, projectIds, permissions. | Switching accessType enforces validation (e.g. moving to projects requires projectIds). When you change scopes, the API automatically replaces the associated project or permission relations. |
DELETE /api/api-keys/{id} | — | Responds with 204 No Content. |
Using keys
- Send the key with every request via
x-api-keyorAuthorization: ApiKey <secret>.Authorization: Bearer <secret>also works when your client library only supports bearer tokens. - When both a session cookie and an API key are present, Browsary prefers the more privileged identity (session first, then key).
- Keys scoped to specific projects will receive HTTP 400 errors if they call endpoints outside the allowed list.