APG PayAPG Paydocs

Reference data

List rule policy versions

GET/rule-policies/{rulePolicyId}/versions
Request
GEThttps://api.tst.au.apgpay.dev/rule-policies/{rulePolicyId}/versions
curl -X GET https://api.tst.au.apgpay.dev/rule-policies/{rulePolicyId}/versions \
  -H "Authorization: Bearer $API_KEY"

Return a page of the versions of a policy, oldest first, each with its rule, what it changed, why, by whom and when.

Permissions

Required permission
rules:query

Requires the `query` action on `rules` for the supplied runtime context

Path parameters

rulePolicyIdstring
required

Query parameters

pageinteger (int32)

Offset pagination: 1-based page number. Mutually exclusive with the cursor parameters.

startingAfterstring

Cursor pagination, moving forward: the id of the last item on the current page. Mutually exclusive with page.

endingBeforestring

Cursor pagination, moving backward: the id of the first item on the current page. Mutually exclusive with page.

limitinteger (int32)

Maximum items per page.

Responses

The response is a tagged shape: type is always "RpolVersionPageAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "RpolVersionPageAttributes"
hasMorebooleanrequired

Whether further items exist after this page.

Example true

nextStartingAfterstring

Id to pass as startingAfter to fetch the next page. Present in cursor mode only.

totalCountinteger (int64)

Total items matching the query.

Example 42

pageinteger (int32)

The 1-based page returned. Present in offset mode only.

Example 1250

totalPagesinteger (int32)

Total pages available. Present in offset mode only.

Example 1250

Example
{
  "type": "RpolVersionPageAttributes",
  "data": [
    {
      "type": "RpolVersionAttributes",
      "version": 1250,
      "state": "Draft",
      "mode": "Shadow",
      "paused": true,
      "rule": {
        "type": "RpolRuleAttributes",
        "templateId": "string",
        "arguments": [
          {
            "type": "RpolArgumentAttributes",
            "parameterId": "string",
            "value": {
              "type": "RpolValueAmount",
              "amount": {
                "type": "IsoCurrencyAmount",
                "minorCurrencyUnits": 1250,
                "currency": "AUD"
              }
            }
          }
        ],
        "action": {
          "type": "RpolActionAttributes",
          "name": "Ada Lovelace"
        }
      },
      "templateVersion": 1250,
      "description": "string",
      "effectiveFrom": "2026-08-19T04:21:07Z",
      "effectiveUntil": "2026-08-19T04:21:07Z",
      "retiredAt": "2026-08-19T04:21:07Z",
      "change": "Created",
      "reasonCode": "NewTypology",
      "reason": "Requested by the customer.",
      "changedBy": "string",
      "changedAt": "2026-08-19T04:21:07Z",
      "approvedBy": "string",
      "approvedAt": "2026-08-19T04:21:07Z",
      "rejectedBy": "string",
      "rejectedAt": "2026-08-19T04:21:07Z"
    }
  ],
  "hasMore": true,
  "nextStartingAfter": "string",
  "totalCount": 42,
  "page": 1250,
  "totalPages": 1250
}

Error responses