APG PayAPG Paydocs

Reporting

Update export

PATCH/exports/{exportId}

Cancel one of your exports while it is queued or being written, or retry one that failed or whose file has expired. A cancel answers the export as it now is; a retry answers the new export.

2 actionsExptUpdateCancelExptUpdateRetry

Permissions

Required permission
reports:query

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

Path parameters

exportIdstring
required

Request body

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

Discriminated by type
type = "ExptUpdateCancel"

This variant has no additional fields.

curl -X PATCH https://api.tst.au.apgpay.dev/exports/{exportId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "ExptUpdateCancel"
}'

Responses

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

Discriminated by type
type = "ExptViewAttributes"
exportIdExptIdrequired

Identifier of an export.

Example expt_9f2Kd8QpLzXw

sourcestringrequired

What it exports.

sourceKindExptSourceKindrequired

What its source reads.

ListQuestionDashboardUnknown
summarystringrequired

What was asked of the source: the names of the parameters given, never their values.

stateExptStaterequired
QueuedRunningDoneFailedExpiredCancelledDeletedUnknown
rowsWritteninteger (int64)required

Rows written so far, the header aside.

Example 1250

bytesWritteninteger (int64)required

Bytes of the compressed file written so far.

Example 1250

failureCodeExptFailureCode

Why it failed, as a code, when it has.

RefusedTooLargeTooSlowWaitedTooLongStoppedInterruptedNotWrittenQueueGaveUpUnknown
failurestring

Why it failed, in words, when it has.

downloadUrlstring

When it is done: a link to the file, signed for you as you asked and valid for a few minutes. Read the export again for a fresh one.

Example https://example.com/callback

downloadUrlExpiresAtstring (date-time)

When downloadUrl stops working.

Example 2026-08-19T04:21:07Z

createdAtstring (date-time)required

Example 2026-08-19T04:21:07Z

startedAtstring (date-time)

When it was first taken up to be written.

Example 2026-08-19T04:21:07Z

finishedAtstring (date-time)

When it was done, failed or cancelled.

Example 2026-08-19T04:21:07Z

Example
{
  "type": "ExptViewAttributes",
  "exportId": "expt_9f2Kd8QpLzXw",
  "source": "string",
  "sourceKind": "List",
  "summary": "string",
  "state": "Queued",
  "rowsWritten": 1250,
  "bytesWritten": 1250,
  "failureCode": "Refused",
  "failure": "string",
  "downloadUrl": "https://example.com/callback",
  "downloadUrlExpiresAt": "2026-08-19T04:21:07Z",
  "createdAt": "2026-08-19T04:21:07Z",
  "startedAt": "2026-08-19T04:21:07Z",
  "finishedAt": "2026-08-19T04:21:07Z"
}

Error responses