Skip to main content
POST
Create User
Mint a per-user API key scoped to a single index. Requires RBAC enabled on the service (CYBORGDB_SERVICE_ROOT_KEY set) and the request must be authenticated with the root key.
See Multi-Tenancy & RBAC for the full operator playbook.

Authentication

Required — root API key in the X-API-Key header:
The core license key (CYBORGDB_API_KEY) is not a service credential; sending it as X-API-Key returns 401 (“Invalid API Key”). A 403 is returned only for a valid non-root credential (a cdbk_ user token).

Path Parameters

Request Body

For POST, the index key rides in the JSON body as index_key (alongside permissions). The sibling GET /v1/indexes/{index_name}/users and DELETE /v1/indexes/{index_name}/users/{user_id} endpoints have no request body, so they take the same key via the X-Index-Key header instead.

Response

The returned api_key is shown only in this response and is never persisted by the service. If you lose it, revoke the user (DELETE) and mint a new one.

Exceptions

permissions is missing, empty, or contains values outside {"read", "write"}.
Authentication failed (invalid root API key).
RBAC is not enabled (CYBORGDB_SERVICE_ROOT_KEY unset), or the caller is not using the root key.
Index not found.
Internal server error.

Example Usage

Read-only user:
SDK-supplied index (KEK in body):