APG PayAPG Paydocs

Identity

Update role

PATCH/roles/{roleId}

Change a role's name, or replace what it grants.

3 actionsRoleUpdateGrantsRoleUpdateGroupingRoleUpdateRename

Permissions

Required permission
roles:update

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

Path parameters

roleIdstring
required

Request body

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

Discriminated by type
type = "RoleUpdateGrants"
namestring

Rename it at the same time, if you want to. Omit to keep the current name.

Example Ada Lovelace

Every grant the role should carry. At least one, a role that permits nothing should be deleted.

curl -X PATCH https://api.tst.au.apgpay.dev/roles/{roleId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "RoleUpdateGrants",
  "name": "Ada Lovelace",
  "grants": [
    {
      "type": "RoleGrantAttributes",
      "resource": "BlockedCard",
      "actions": [
        "Create"
      ]
    }
  ]
}'

Responses

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

Discriminated by type
type = "RoleUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "RoleUpdateRspAttributes",
  "updated": {
    "type": "RoleViewBuiltIn",
    "roleId": "role_9f2Kd8QpLzXw",
    "name": "Ada Lovelace",
    "grants": [
      {
        "type": "RoleGrantAttributes",
        "resource": "BlockedCard",
        "actions": [
          "Create"
        ]
      }
    ],
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses