APG PayAPG Paydocs

Identity

Update user

PATCH/users/{userId}

Change a user's name, identifiers, permissions or status.

Permissions

Required permission
users:update

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

Path parameters

userIdstring
required

Request body

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

Discriminated by type
type = "UserUpdateAttributes"
displayNamestring

Example Ada Lovelace

Replaces the user's permissions outright, send the full set you want. Granting a merchant, revoking one, or moving a user between merchants are all this field.

statusUserStatus

Disabled stops the user signing in without deleting them.

EnabledDisabledUnknown
curl -X PATCH https://api.tst.au.apgpay.dev/users/{userId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "UserUpdateAttributes",
  "displayName": "Ada Lovelace",
  "permissions": [
    {
      "type": "UserPermissionAttributes",
      "domain": {
        "type": "UserDomainAnonymous",
        "restrictedTo": {
          "type": "UserDomainCustomer",
          "customerId": "cust_9f2Kd8QpLzXw"
        }
      },
      "roles": [
        "role_9f2Kd8QpLzXw"
      ]
    }
  ],
  "status": "Enabled"
}'

Responses

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

Discriminated by type
type = "UserUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "UserUpdateRspAttributes",
  "updated": {
    "type": "UserViewAttributes",
    "userId": "user_9f2Kd8QpLzXw",
    "displayName": "Ada Lovelace",
    "identifiedBy": [
      {
        "type": "UserIdEmail",
        "emailAddress": "ada@example.com"
      }
    ],
    "authorisedTo": [
      {
        "type": "UserPermissionAttributes",
        "domain": {
          "type": "UserDomainAnonymous",
          "restrictedTo": {
            "type": "UserDomainCustomer",
            "customerId": "cust_9f2Kd8QpLzXw"
          }
        },
        "roles": [
          "role_9f2Kd8QpLzXw"
        ]
      }
    ],
    "status": "Enabled",
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses