V1 / Tokens / Api-keys / Index
Create an API key
Create a space-scoped API key. The plain token is returned once, on creation. Session-authenticated (dashboard login; owner/admin).
V1 / Tokens / Api-keys / Index
Create an API key
Create a space-scoped API key. The plain token is returned once, on creation. Session-authenticated (dashboard login; owner/admin).
POST
/api/v1/tokens/api-keys/indexRequest body
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Key name (max 200 chars) |
| expiresAt | string | No | ISO datetime expiry |
| neverExpires | boolean | No | No expiry. Default: false |
| shortToken | boolean | No | Shorter ~96-bit token instead of ~256-bit. Default: false |
| scopes | object | No | Optional restrictions: { mcpTools?: string[], apiEndpoints?: string[] }. Omit a list to allow all; [] denies all. |
Responses
200
JSON { doc } including the plain token (shown only once)
401
Not logged in
Request
curl -X POST "https://bannx.com/api/v1/tokens/api-keys/index" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{"name":"string","expiresAt":"string","neverExpires":false,"shortToken":false,"scopes":null}'Response
// JSON { doc } including the plain token (shown only once)
{
"success": true,
"data": { ... }
}