APG PayAPG Paydocs

Identity

Update API key

PATCH/api-keys/{apiKeyId}

Change a token's description, expiry, status or permissions. One change per call, the arm says which.

4 actionsApiKeyUpdateDescriptionApiKeyUpdateExpirationApiKeyUpdatePermissionsApiKeyUpdateStatus

Permissions

Required permission
serviceTokens:update

Requires the `update` action on `serviceTokens` for the supplied runtime context

Path parameters

apiKeyIdstring
required

Request body

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

Discriminated by type
type = "ApiKeyUpdateDescription"
descriptionstringrequired
curl -X PATCH https://api.tst.au.apgpay.dev/api-keys/{apiKeyId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "ApiKeyUpdateDescription",
  "description": "string"
}'

Responses

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

Discriminated by type
type = "ApiKeyUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "ApiKeyUpdateRspAttributes",
  "updated": {
    "type": "ApiKeyViewAttributes",
    "apiKeyId": "key_9f2Kd8QpLzXw",
    "description": "string",
    "scope": {
      "type": "ApiKeyScopeEnterprise",
      "enterpriseId": "ent_9f2Kd8QpLzXw"
    },
    "permissions": {
      "type": "ApiKeyPermissionsExplicit",
      "grants": [
        {
          "type": "ApiKeyGrantAttributes",
          "resource": "BlockedCard",
          "actions": [
            "Query"
          ]
        }
      ]
    },
    "status": "Enabled",
    "value": "string",
    "expiresAt": "2026-08-19T04:21:07Z",
    "createdBy": "string",
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses