AlmondTill/G3N API

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.

Arguments

NameTypeRequiredNotes
inputMintApiKeyInput MintApiKeyInput!yesNo 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

Used in