Skip to main content
POST
Exchange an OAuth token for a key

Authorizations

Authorization
string
header
required

The access token an MCP client holds. Accepted only by POST /keys and the key-request routes.

Body

application/json
workspace_id
string
required

A workspace id from list_workspaces.

name
string
required
Required string length: 1 - 80
scopes
enum<string>[]
required

Every scope must be one the OAuth token holds.

Minimum array length: 1
Available options:
datalyr:read,
datalyr:write:rules,
datalyr:write:links,
datalyr:propose:scripts
expires_in
integer
default:7776000

Seconds. Defaults to 90 days.

Required range: 86400 <= x <= 31536000

Response

Created. The key appears in this response only.

key
string
required

The plaintext dk_agent_ key. Returned in this response only.

key_id
string<uuid>
required
key_prefix
string
required
scopes
string[]
required
expires_at
string<date-time>
required