exchangeApiKey
mutation · in the family Open doors
What it does
An integration’s sign-in — it exchanges its API key secret for a working session.
Exchange an ApiKey secret for an API session: the key must be active AND reach-live (the minter's current ownerships — group + the named org); mints the 24 h-absolute no-idle API session and returns the bearer token once. Every failure is uniform.
Before you call
No key needed for this call.
Careful
Every failure is uniform — nothing leaks about which keys exist.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | ExchangeApiKeyInput ExchangeApiKeyInput! | yes | Input for exchangeApiKey. |
Returns
ApiKeyExchangeResult ApiKeyExchangeResult! — The exchangeApiKey result — the opaque API-session bearer token (returned once) + its absolute deadline.
Example request
graphql
mutation ExampleExchangeApiKey($input: ExchangeApiKeyInput!) {
exchangeApiKey(input: $input) {
token
expiresAt
}
}Variables:
json
{
"input": {
"secret": "<your key secret>",
"orgId": "01900000-0000-7000-8000-1971e30a0000"
}
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
json
{
"data": {
"exchangeApiKey": {
"token": "<your session token>",
"expiresAt": "2028-01-31T00:00:00.000Z"
}
},
"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. Retry: no. (VALIDATION)AUTHN/LOGIN_FAILED— The sign-in was not accepted. Retry: no. (AUTHN)RATE_LIMIT/LOGIN_LOCKED— Too many failed sign-in attempts. Retry: yes. (RATE_LIMIT)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)