AlmondTill/G3N API

On this page

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.

Careful

Every failure is uniform — nothing leaks about which keys exist.

Who may call it

No key needed for this call.

Arguments

NameTypeRequiredNotes
inputExchangeApiKeyInput ExchangeApiKeyInput!yesNo further notes.

Returns

ApiKeyExchangeResult ApiKeyExchangeResult! — The exchangeApiKey result — the opaque API-session bearer token (returned ONCE) + its absolute deadline.

Example request

mutation ExampleExchangeApiKey($input: ExchangeApiKeyInput!) {
  exchangeApiKey(input: $input) {
    token
    expiresAt
  }
}

Variables:

{
  "input": {
    "secret": "<your key secret>",
    "orgId": "01900000-0000-7000-8000-b0cf4f3c0000"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "exchangeApiKey": {
      "token": "<your session token>",
      "expiresAt": "2027-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