AlmondTill/G3N API

On this page

approvalRequest

query · in the family Approval request

What it does

Look up one record — an approval request — asking a manager’s authority for an act above your limit.

A ApprovalRequest by id, within the caller's OWN org-group family; requires authentication. A cross-tenant id reads as null (not-found) AND trips the rootId tripwire server-side.

What happens

Reads only — changes nothing.

Who may call it

Capability area: Reading your records — Looking up and listing the records of your organization.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.

Returns

ApprovalRequest — An ApprovalRequest — the real-time, human-approver, in-session authorization of ONE POS action exceeding the requester's authority (DISTINCT from the async ChangeRequest). The blocked action stays blocked until resolved; short TTL (expiresAt — a touch past it refuses CONFLICT/EXPIRED and lazily expires the request). The request binds a fingerprint (action, targetId[, valueMinor]) + the requester: on approval, RETRYING the identical gated call finds + consumes the approval by fingerprint (single-use — the marker releases in the retry's own transaction). Never self-approve (AUTHZ/SELF_APPROVAL); an under-ranked approver is AUTHZ/INSUFFICIENT.

Example request

query ExampleApprovalRequest($id: ID!) {
  approvalRequest(id: $id) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    action
    targetType
    targetId
    valueMinor
    requestedBy
    requiredTier
    reason
    expiresAt
    decidedBy
    decidedAt
    decisionReason
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000"
}

Example response

{
  "data": {
    "approvalRequest": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "AR-EXMP-0000-000F",
      "type": "ApprovalRequest",
      "caption": "Blue jeans",
      "status": "pending",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "action": "<action>",
      "targetType": "<target type>",
      "targetId": "01900000-0000-7000-8000-446adfd50000",
      "valueMinor": 1,
      "requestedBy": "01900000-0000-7000-8000-dae980de0000",
      "requiredTier": "owner",
      "reason": "Correcting a miscount.",
      "expiresAt": "2027-01-31T00:00:00.000Z",
      "decidedBy": "01900000-0000-7000-8000-d4d316ba0000",
      "decidedAt": "2027-01-31T00:00:00.000Z",
      "decisionReason": "<decision reason>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer