Authentication
Personal API Tokens (wn_)
Create, scope, and revoke personal access tokens for the Public REST API and MCP Bearer auth.
Personal API Tokens (wn_)
Personal tokens authenticate scripts, CI, MCP clients (Bearer), and the Public REST API. Tokens are prefixed wn_ and stored as hashes server-side.
Endpoints
Base: https://<APP_HOST>/api/v1/api-tokens
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /scopes | api_tokens:read | List available scope keys |
GET | /get-tokens | api_tokens:read | List your tokens (no plaintext) |
POST | /create-token | api_tokens:write | Create a token (returns plaintext once) |
POST | /:id/revoke | api_tokens:delete | Revoke a token |
Create token
curl -X POST "https://<APP_HOST>/api/v1/api-tokens/create-token" \
-H "Authorization: Bearer wn_live_..." \
-H "Content-Type: application/json" \
-H "X-Workspace-Id: <WORKSPACE_ID>" \
-d '{
"name": "CI deployer",
"scopes": ["notes:read", "notes:write", "projects:read"],
"expiresAt": "2027-01-01T00:00:00.000Z",
"workspaceId": "<WORKSPACE_UUID>"
}'| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | Display label |
scopes | string[] | no | Subset of catalog; omit only if your client defaults scopes |
expiresAt | ISO datetime | no | Optional expiry |
workspaceId | uuid | no | Optional workspace binding |
Using a token
Authorization: Bearer wn_live_YOUR_TOKEN
X-Workspace-Id: <WORKSPACE_ID>- Public REST:
https://<APP_HOST>/api/public/v1/... - MCP Bearer:
Authorization: Bearer wn_…againsthttps://<MCP_HOST>/v1/mcp
Scope catalog
Scopes mirror workspace RBAC. Common groups:
Notes & projects
| Scope | Access |
|---|---|
notes:read / notes:write / notes:delete | Notes and content |
projects:read / projects:write / projects:delete | Projects, stages, tasks |
projects:admin | Project administration |
tags:read / tags:write / tags:delete | Tags |
priorities:read / priorities:write / priorities:delete | Task priorities |
AI & agents
| Scope | Access |
|---|---|
ai_chat:read / ai_chat:write / ai_chat:delete | Chat sessions |
ai_agents:read / ai_agents:write / ai_agents:delete / ai_agents:execute | Agents |
ai_artifacts:read / ai_artifacts:write / ai_artifacts:delete | Artifacts |
sandbox:execute | Agent sandbox |
Integrations & MCP
| Scope | Access |
|---|---|
integrations:read / integrations:write / integrations:delete | Native integrations |
mcp_connectors:read / mcp_connectors:write / mcp_connectors:delete | External MCP connectors |
webhooks:read / webhooks:write / webhooks:delete | Webhooks |
Profile & workspace
| Scope | Access |
|---|---|
users:read | User search |
profile:read / profile:write / profile:delete | Profile |
workspaces:read / workspaces:write / workspaces:delete | Workspaces |
workspace_members:read / workspace_members:write / workspace_members:delete | Members |
api_tokens:read / api_tokens:write / api_tokens:delete | Manage tokens |
Fetch the live list:
curl "https://<APP_HOST>/api/v1/api-tokens/scopes" \
-H "Authorization: Bearer wn_live_..." \
-H "X-Workspace-Id: <WORKSPACE_ID>"Revoke
curl -X POST "https://<APP_HOST>/api/v1/api-tokens/<TOKEN_ID>/revoke" \
-H "Authorization: Bearer wn_live_..." \
-H "X-Workspace-Id: <WORKSPACE_ID>"Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid token |
403 | Token lacks required scope |
422 | Invalid body (e.g. unknown scope string) |
For browser OAuth into MCP clients (Claude.ai, ChatGPT), see MCP OAuth.