Create users
/usersCreate a user.
Permissions
users:createRequires 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.
typetype = "UserCmdCreate"displayNamestringrequiredExample Ada Lovelace
How this user can be recognised. At least one identifier.
typeAn email address.
emailAddressstringrequiredExample ada@example.com
The user's identity at an external OIDC provider.
oidcProviderIdOidcidpIdrequiredIdentifier of an OIDC provider.
Example oidcidp_9f2Kd8QpLzXw
subjectstringrequiredThe sub claim of that provider's ID tokens.
A phone number, E.164 format.
phoneNumberstringrequiredExample +61400000000
A service token. Instantiate several for overlapped key rolling.
apiKeyIdApiKeyIdrequiredIdentifier of a service token.
Example key_9f2Kd8QpLzXw
The domains this user holds permissions in. A user may hold several; a session selects one.
typeenumrequiredUserPermissionAttributestypeAn unauthenticated caller, restricted to what the wrapped domain permits.
typeOne customer.
customerIdCustIdrequiredIdentifier of a customer.
Example cust_9f2Kd8QpLzXw
A delegate acting for one customer. Scoped by both, because a delegate can act for several.
delegateIdCustdIdrequiredIdentifier of a customer delegate.
Example custd_9f2Kd8QpLzXw
forCustomerIdCustIdrequiredIdentifier of a customer.
Example cust_9f2Kd8QpLzXw
loanAccessarray of LoanIdLoans this delegate may act on for this customer; absent = unrestricted.
Example loan_9f2Kd8QpLzXw
One enterprise.
enterpriseIdEntIdrequiredIdentifier of an enterprise.
Example ent_9f2Kd8QpLzXw
One marketplace.
marketplaceIdMktpIdrequiredIdentifier of a marketplace.
Example mktp_9f2Kd8QpLzXw
One merchant.
merchantIdMchtIdrequiredIdentifier of a merchant.
Example mcht_9f2Kd8QpLzXw
The whole platform. Held by platform operators.
The whole platform. Held by platform operators.
One customer.
customerIdCustIdrequiredIdentifier of a customer.
Example cust_9f2Kd8QpLzXw
A delegate acting for one customer. Scoped by both, because a delegate can act for several.
delegateIdCustdIdrequiredIdentifier of a customer delegate.
Example custd_9f2Kd8QpLzXw
forCustomerIdCustIdrequiredIdentifier of a customer.
Example cust_9f2Kd8QpLzXw
loanAccessarray of LoanIdLoans this delegate may act on for this customer; absent = unrestricted.
Example loan_9f2Kd8QpLzXw
One enterprise.
enterpriseIdEntIdrequiredIdentifier of an enterprise.
Example ent_9f2Kd8QpLzXw
One marketplace.
marketplaceIdMktpIdrequiredIdentifier of a marketplace.
Example mktp_9f2Kd8QpLzXw
One merchant.
merchantIdMchtIdrequiredIdentifier of a merchant.
Example mcht_9f2Kd8QpLzXw
A domain that no longer resolves, the party it named is gone.
A domain that no longer resolves, the party it named is gone.
The whole platform. Held by platform operators.
The whole platform. Held by platform operators.
rolesarray of RoleIdExample role_9f2Kd8QpLzXw
statusUserStatusCreate the user disabled, to be enabled later. Defaults to Enabled.
EnabledDisabledUnknowncurl -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.
typetype = "UserCreateRspAttributes"The resource that was created.
typeenumrequiredUserViewAttributesuserIdUserIdrequiredIdentifier of a user.
Example user_9f2Kd8QpLzXw
displayNamestringrequiredExample Ada Lovelace
The identifiers this user can be recognised by.
typeAn email address.
emailAddressstringrequiredExample ada@example.com
The user's identity at an external OIDC provider.
oidcProviderIdOidcidpIdrequiredIdentifier of an OIDC provider.
Example oidcidp_9f2Kd8QpLzXw
subjectstringrequiredThe sub claim of that provider's ID tokens.
A phone number, E.164 format.
phoneNumberstringrequiredExample +61400000000
A service token. Instantiate several for overlapped key rolling.
apiKeyIdApiKeyIdrequiredIdentifier of a service token.
Example key_9f2Kd8QpLzXw
statusUserStatusrequiredEnabledDisabledUnknowncreatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
{
"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
statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}statusCodeinteger (int32)requiredHTTP status code for this error
errorCodestringrequiredAn APG Pay code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type.
messagestringrequiredHuman readable description of the error
tracerstringAn unique identifier for the request. Provide this to the support team if you wish to query a particular error.
detailstringOptional additional details for the error.
errorTypeDescriptionstringA description of the category of errors for the given statusCode.
metadataobjectOptional key value list of metadata
{
"statusCode": 100,
"errorCode": "string",
"message": "string",
"tracer": "string",
"detail": "string",
"errorTypeDescription": "string"
}