Skip to main content
POST
Rotate an MCP token
Rotating invalidates the previous secret immediately and keeps everything else about the token — its description, its scopes, and the agents you have already authorized to use that token record. Two rules worth knowing before you script this:
  • The expiration is preserved. A rotation through an API key keeps the token’s original deadline rather than restarting the term, so rotating often cannot turn a 1-year token into a perpetual one.
  • A token cannot rotate itself. Rotating token A with token A’s own credential returns 400. An assistant rotating a different token on your behalf is fine — that is what this is for.
Like creation, the response carries a reveal_url and no bearer_token, so a person has to open the link to collect the new secret.

Authorizations

x-api-key
string
header
required

API Key authentication. Format: 'x-api-key: api_key'

Path Parameters

id
string
required

Body

description
string
required
Maximum string length: 80
expires_at
string<date-time>

When the token stops working. Optional and create-only — omit it for the default 1-year lifetime. Must be in the future and at most 1 year from now. Requires the mcp_token_custom_expiration feature flag.

use_created_by_permissions
boolean
tool_scope
any | null

Names of the native Nekt MCP tools this token may use. NULL = every tool available to the token's creator, future ones included; [] = none. Restricted tokens only — a full-access token always exposes its creator's whole surface.

live_connection_scopes
object[]
write-only
secret_scopes
string<uuid>[] | null
write-only

Ids of the secrets this restricted token may reference. Omit to inherit the creator's; [] for none.

semantic_layer_scopes
object | null
write-only

Semantic Layer surface of this restricted token: {"folders": [...], "documents": [...]}. A folder covers its whole subtree, resolved at read time. Omit to inherit the creator's.

table_scopes
object | null
write-only

Catalog links for the TABLES axis: {"layers": [...], "folders": [...], "tables": [...]}. A layer or folder link means everything inside it, now and in the future — tables only.

volume_scopes
object | null
write-only

Catalog links for the VOLUMES axis: {"layers": [...], "folders": [...], "volumes": [...]}. The same layer linked here brings volumes only, never tables.

all_tables
boolean
all_volumes
boolean
all_secrets
boolean
all_semantic_layer
boolean
all_live_connections
boolean
tables
string[]

Tables (Expandable)

Response

200 - application/json
id
string<uuid>
required
read-only
description
string
required
Maximum string length: 80
bearer_token
string
required
read-only
last_used_at
string<date-time> | null
required
read-only
created_at
string<date-time>
required
read-only
updated_at
string<date-time>
required
read-only
mcp_config
string
required
read-only

MCP Configuration (Field only visible on expanded view. Expandable)

created_by
integer
required
read-only

Created by (Expandable)

expires_at
string<date-time>

When the token stops working. Optional and create-only — omit it for the default 1-year lifetime. Must be in the future and at most 1 year from now. Requires the mcp_token_custom_expiration feature flag.

use_created_by_permissions
boolean
tool_scope
any | null

Names of the native Nekt MCP tools this token may use. NULL = every tool available to the token's creator, future ones included; [] = none. Restricted tokens only — a full-access token always exposes its creator's whole surface.

all_tables
boolean
all_volumes
boolean
all_secrets
boolean
all_semantic_layer
boolean
all_live_connections
boolean
tables
string[]

Tables (Expandable)