APG PayAPG Paydocs

Identity

Create users

POST/users

Create a user.

Permissions

Required permission
users:create

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

Request body

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

Discriminated by type
type = "UserCmdCreate"
displayNamestringrequired

Example Ada Lovelace

How this user can be recognised. At least one identifier.

The domains this user holds permissions in. A user may hold several; a session selects one.

statusUserStatus

Create the user disabled, to be enabled later. Defaults to Enabled.

EnabledDisabledUnknown
curl -X POST https://api.tst.au.apgpay.dev/users \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "UserCmdCreate",
  "displayName": "Ada Lovelace",
  "identifiedBy": [
    {
      "type": "UserIdEmail",
      "emailAddress": "ada@example.com"
    }
  ],
  "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 "UserCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "UserCreateRspAttributes"

The resource that was created.

Example
{
  "type": "UserCreateRspAttributes",
  "created": {
    "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