APG PayAPG Paydocs

Reporting

Create report query batches

POST/report-query-batches

Ask several questions at once. The answers come back in the order asked, each answered or refused.

Permissions

Required permission
reports:query

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

Request body

This body is a tagged shape: type is always "RqbatCmdRun". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "RqbatCmdRun"

At most 20.

curl -X POST https://api.tst.au.apgpay.dev/report-query-batches \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "RqbatCmdRun",
  "questions": [
    {
      "type": "RqryCmdRun",
      "reportDatasetId": "string",
      "measures": [
        "string"
      ],
      "dimensions": [
        "string"
      ],
      "time": {
        "type": "RqryTimeSliceAttributes",
        "grain": "string",
        "range": {
          "type": "RqryRangeBetween",
          "from": "2026-08-19",
          "to": "2026-08-19"
        },
        "compare": "PreviousPeriod"
      },
      "filters": [
        {
          "type": "RqryFilterAbove",
          "dimension": "string",
          "value": "string"
        }
      ],
      "sort": [
        {
          "type": "RqrySortDimension",
          "dimension": "string",
          "ascending": true
        }
      ],
      "limit": 25,
      "page": "string",
      "segments": [
        "string"
      ],
      "measureFilters": [
        {
          "type": "RqryMeasureFilterAbove",
          "measure": "string",
          "value": "string"
        }
      ],
      "top": {
        "type": "RqryTopAttributes",
        "dimension": "string",
        "count": 42,
        "measure": "string"
      },
      "narrowTo": {
        "type": "RqryNarrowCustomers",
        "customerIds": [
          "cust_9f2Kd8QpLzXw"
        ]
      },
      "asAt": "2026-08-19T04:21:07Z",
      "pivot": {
        "type": "RqryPivotAttributes",
        "rows": [
          "string"
        ],
        "columns": [
          "string"
        ],
        "subtotals": true
      },
      "timezone": "string"
    }
  ]
}'

Responses

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

Discriminated by type
type = "RqbatCreateRspAttributes"

The resource that was created.

Example
{
  "type": "RqbatCreateRspAttributes",
  "created": {
    "type": "RqbatAttributes",
    "answers": [
      {
        "type": "RqbatAnswered",
        "result": {
          "type": "RqryResultAttributes",
          "reportDatasetId": "string",
          "columns": [
            {
              "type": "RqryColumnAttributes",
              "role": "Time",
              "name": "Ada Lovelace",
              "grain": "string",
              "axis": "Rows"
            }
          ],
          "rows": [
            {
              "type": "RqryRowAttributes",
              "level": "Detail",
              "depth": 1250,
              "cells": [
                "string"
              ]
            }
          ],
          "truncated": true,
          "next": "string",
          "asOf": "2026-08-19T04:21:07Z",
          "timezone": "string",
          "labels": [
            {
              "type": "RqryLabelsAttributes",
              "dimension": "string",
              "values": [
                {
                  "type": "RdsetValueAttributes",
                  "value": "string",
                  "label": "string"
                }
              ]
            }
          ],
          "currentAsOf": "2026-08-19T04:21:07Z"
        }
      }
    ]
  }
}

Error responses