AlmondTill/G3N API

approvalRequests

query · in the family Approval request

What it does

The approval request list — each entry is an approval request — asking a manager’s authority for an act above your limit.

The ApprovalRequests your organization group holds today. Doomed records leave the listing but stay readable by id. Paged: limit clamps to 1–200, default 100; nextToken is the previous page's cursor, passed back exactly as received (a malformed or foreign token is refused as VALIDATION/INVALID). Walk until nextToken is null; a page may hold fewer than limit, and doomed records leave the listing.

Before you call

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

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

Roles that may call it:

What happens

Reads only — changes nothing.

Arguments

NameTypeRequiredNotes
limitIntnoHow many records to answer at most; a page may hold fewer.
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.

Returns

ApprovalRequestPage ApprovalRequestPage! — One page of the approvalRequests listing — the records + the opaque resume cursor.

This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. limit clamps to 1–200, default 100; nextToken continues the page. See paging.

Example request

graphql
query ExampleApprovalRequests($limit: Int) {
  approvalRequests(limit: $limit) {
    items {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      action
      targetType
      targetId
      valueMinor
      requestedBy
      requiredTier
      reason
      expiresAt
      decidedBy
      decidedAt
      decisionReason
    }
    nextToken
  }
}

Variables:

json
{
  "limit": 1
}

Example response

json
{
  "data": {
    "approvalRequests": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-e7259dcb0000",
          "sysId": "AR-EXMP-0000-000F",
          "type": "ApprovalRequest",
          "caption": "Blue jeans",
          "status": "pending",
          "parentId": "01900000-0000-7000-8000-4ed885220000",
          "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",
          "action": "<action>",
          "targetType": "<target type>",
          "targetId": "01900000-0000-7000-8000-8b67f1680000",
          "valueMinor": 1250,
          "requestedBy": "01900000-0000-7000-8000-dae980de0000",
          "requiredTier": "owner",
          "reason": "Correcting a miscount.",
          "expiresAt": "2028-01-31T00:00:00.000Z",
          "decidedBy": "01900000-0000-7000-8000-d4d316ba0000",
          "decidedAt": "2027-01-31T00:00:00.000Z",
          "decisionReason": "<decision reason>"
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer