APG PayAPG Paydocs

Reporting

Create report spaces

POST/report-spaces

Save a space, or with RspcCmdDefault find or make the caller's default space. A shared one needs Reports_Manage as well.

2 actionsRspcCmdCreateRspcCmdDefault

Permissions

Required permission
reports:query

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

Request body

This body is a typed union. Pick a variant to see its fields and a matching example.

Discriminated by type
type = "RspcCmdCreate"
namestringrequired

Example Ada Lovelace

accessRspcAccessrequired

Private for the caller alone, or Shared for its tenant, which needs Reports_Manage.

PrivateSharedSystemUnknown
parentReportSpaceIdRspcId

The space to put it in, which must be the caller's to change and of the same access. Absent for the top.

Example rspc_9f2Kd8QpLzXw

curl -X POST https://api.tst.au.apgpay.dev/report-spaces \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "RspcCmdCreate",
  "name": "Ada Lovelace",
  "access": "Private",
  "parentReportSpaceId": "rspc_9f2Kd8QpLzXw"
}'

Responses

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

Discriminated by type
type = "RspcCreateRspAttributes"

The resource that was created.

Example
{
  "type": "RspcCreateRspAttributes",
  "created": {
    "type": "RspcViewAttributes",
    "reportSpaceId": "rspc_9f2Kd8QpLzXw",
    "name": "Ada Lovelace",
    "access": "Private",
    "parentReportSpaceId": "rspc_9f2Kd8QpLzXw",
    "tenant": {
      "type": "RspcTenantEnterprise",
      "enterpriseId": "ent_9f2Kd8QpLzXw"
    },
    "ownedByCaller": true,
    "editable": true,
    "isDefault": true,
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z",
    "icon": "string"
  }
}

Error responses