AlmondTill/G3N API

doomUser

mutation · in the family User

What it does

Permanently retire a staff user.

Doom a User by id; requires the unrestricted capability + the record's current revision. Sessions never block and never cascade: the doomed user's sessions go inert at their next resolve and ride to their own natural terminal. An active ApiKey minted by this user blocks the doom → CONFLICT/REFERENCED naming the keys: ApiKey has no parent-doom cascade, so key disposition is explicit — doom the keys (or let them expire) first; terminal keys never block. The (account × group) userBinding marker stays with the doomed record as history and is taken over by a future re-add — dooming never permanently strands the pair. The optional reason rides the transition events.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Identity and access — Who can sign in and what each role allows — users, roles and their assignments.

Roles that may call it:

Careful

Doom is forever — a doomed record never comes back into use (its history remains readable). Anything still referencing it live will block the doom.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonStringno

Concurrency

Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

User User! — A user — an Account AT an Organization Group, holding Roles per organization within the group; the principal a login resolves. Fully realized since: createUser binds an existing Account into the caller's group, and the lifecycle transitions ride the operational template with the ruled session semantics — sessions never block and never cascade; a non-active User's sessions go inert at the next resolve.

Example request

graphql
mutation ExampleDoomUser($id: ID!, $revision: ID!, $reason: String) {
  doomUser(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    accountId
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-e0a63e120000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

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

Example response

json
{
  "data": {
    "doomUser": {
      "id": "01900000-0000-7000-8000-e0a63e120000",
      "sysId": "US-EXMP-0000-000F",
      "type": "User",
      "caption": "Blue jeans",
      "status": "doomed",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "accountId": "01900000-0000-7000-8000-59f8a2fc0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer