Authentication and API keys
Project API keys, personal access tokens and browser sessions.
Credentials
| Credential | Format | Use it for |
|---|---|---|
| Project API key | thk_ + 40 characters | Programs and integrations that work on one project. Accepted only by /api/v1/* and /api/svc/*. |
| Personal access token | ank_… | Scripts that act as you, across your projects. Add ?space=<project> on /api/v1. Created at account.ankiren.com. |
| Browser session | Cookie on .openthink.app | Web pages and HTML pages inside OpenThink. |
Send keys and tokens in the Authorization header:
Authorization: Bearer thk_...API keys
- A key belongs to one project. Only the project owner can create, rotate and revoke keys, and a key cannot manage other keys.
- Scope is Read only (
read) or Read and write (write). A read-only key gets 403 on writes and can call onlyGETservice routes. - Expiry: none, or 1 to 3,650 days.
- OpenThink stores only a SHA-256 hash and the last four characters. The full key is shown once, when you create it.
- Rows written with a key record the key's name as their creator, for example
n8n. - Up to 20 keys per project.
Keys limited to tables
When you create a key you can limit it to 1–50 tables. It then sees and writes only those tables; other tables return 404. Endpoints that reach every table return 403: POST /sql, HTML page files, webhooks for all tables, and service routes.
Rotating a key
Rotating creates a new key with the same name, scope and tables. The old key keeps working for a grace period (24 hours in the console, 0–168 hours over the API), and webhooks registered by the old key move to the new one.
Revoking a key
A revoked key stops working immediately, and the webhooks it registered are removed.
Managing keys over REST
These endpoints take the owner's session or personal access token, not an API key.
/api/spaces/{project}/keysList keys./api/spaces/{project}/keysCreate a key. Body: name, scope, days, tables./api/spaces/{project}/keys/{keyId}/rotateRotate a key. Body: graceHours, days./api/spaces/{project}/keys/{keyId}Revoke a key.{ "name": "n8n", "scope": "write", "days": 90, "tables": ["8fbd6f8b8444"] }The response is 201 with { key, token }. token is the secret and is returned only this once.