Auth

Create a new API key

Changed on

Creates a new API key for the authenticated person. It acts in the workspace the request acts in, and a key made with a key gets a scope no wider than its own. The key is returned in plaintext only once - store it securely. Use a descriptive name to identify the key's purpose (e.g., 'Production', 'Claude Desktop', 'Cursor').

post/v1/auth/keys

Request

  • Base URL: https://api.zindex.ai
  • URL: https://api.zindex.ai/v1/auth/keys
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Request body

namestring

A descriptive name for this key to identify its purpose. Examples: 'Production API', 'Claude Desktop', 'Cursor', 'Development'. If omitted, the key has no name (null).

expiresInDaysinteger nullable

Number of days until the key expires. Integer in [1, 366] inclusive (covers a leap year), or null/omitted for a key that never expires. After expiry, requests with this key return 401 with code 'API_KEY_EXPIRED'. Default: null (never expires) - matches the agent-host integration pattern where the key lives in a long-lived MCP config file.

scope'write' | 'read'

write: read, change, share and report diagrams. read: read only. Default write when the caller can write, else read.

Example request

{
  "name": "Production API"
}

Response

API key created

idstring required
keystring required

The API key (shown only once). Prefixed with dsp_sk_

ownerIdstring required
workspaceIdstring required

The workspace the key acts in: the one the request acted in

scope'write' | 'read' required
namestring nullable
expiresAtstring date-time nullable required

ISO-8601 UTC timestamp when the key expires, or null if it never expires. Echoes the server-computed expiry from the request's expiresInDays (now + N days). Used by clients to display 'Expires on YYYY-MM-DD' in their UI.

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status