On this page
mintApiKey
mutation · in the family System and integration setup
What it does
Mint an API key — a machine credential for your integrations.
Mint an ApiKey: OWNER-gated ENGINE-side (the minting actor's Account must hold group ownership LIVE — reach derives from those ownerships at every call); descriptors ride the grammar (≥1, deduped, IMMUTABLE); expiresAt ≤ 12 months (clock-gated); returns the key + the secret ONCE (hash-only at rest). Template class (integration config — Manager's hard-disallow correctly blocks the attempt at the descriptor layer; hand-derived v30).
What happens
The secret shows ONCE at minting and never again; only its facts remain visible.
Careful
OWNER-gated. A key is a standing credential — scope it narrowly and rotate it on schedule (12-month maximum).
Who may call it
Capability area: System and integration setup — Registers, connections and the settings your systems run on.
- Owner
- System Administrator
- An API key whose scope allows
api:mintApiKey
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | MintApiKeyInput MintApiKeyInput! | yes | No further notes. |
Returns
ApiKeyMint ApiKeyMint! — The mintApiKey result — the key + its secret, returned ONCE (hash-only at rest; presented only to exchangeApiKey).
Example request
mutation ExampleMintApiKey($input: MintApiKeyInput!) {
mintApiKey(input: $input) {
secret
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"descriptors": [
{
"service": "<service>",
"action": "<action>",
"polarity": "allow"
}
],
"expiresAt": "2027-01-31T00:00:00.000Z"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"mintApiKey": {
"secret": "<your key secret>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. (VALIDATION)