Skip to content

Issue a new scoped API key (raw key returned once)

Requires project role ADMIN+. The raw key is returned exactly once in the response and can never be retrieved again. The resulting key is used as X-API-Key on the ingest/decision/ coupon/metrics/mcp APIs, gated by the scopes granted here.

projectId
required
string
Media typeapplication/json
object
name
required
string
>= 1 characters <= 120 characters
scopes
required
Array<string>
>= 1 items
Allowed values: ingest:write decision:read coupon:redeem coupon:read metrics:read metrics:write profile:write decision:call tracking:ingest mcp:events_read mcp:events_write mcp:links_write mcp:attribution_read

Created (includes raw key once)

Media typeapplication/json
object
key
object
id
string
projectId
string
name
string | null
scopes
Array<string>
Allowed values: ingest:write decision:read coupon:redeem coupon:read metrics:read metrics:write profile:write decision:call tracking:ingest mcp:events_read mcp:events_write mcp:links_write mcp:attribution_read
revoked
boolean
createdAt
string
revokedAt
string | null
keyMasked
string
key

Raw API key — shown only on creation

string
warning
string

Missing projectId

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Not authorized

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Needs project ADMIN

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Validation failed

Media typeapplication/json
object
error
required
string
issues
Array<object>
object
path
string
message
string
details
Array<object>
object
key
additional properties
any
key
additional properties
any
Example
json
{
"error": "参数校验失败"
}