Create roles
/rolesDefine a role, carrying its own grants or grouping other roles. Selected by the body's type.
RoleCmdCreateRoleCmdCreateGroupingPermissions
roles:createRequires the `create` action on `roles` for the supplied runtime context
Request body
This body is a typed union. Pick a variant to see its fields and a matching example.
typetype = "RoleCmdCreate"namestringrequiredExample Ada Lovelace
The domain that owns this role. Carries the party it is restricted to.
typeAn 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.
typeenumrequiredRoleGrantAttributesresourcePermissionResourcerequiredThe resource this grant is over.
BlockedCardCustomerDelegatesDisputesEnterprisesFxRatesLoanFacilitiesLoanProductsLoanTransactionsLoanMasterAgreementsLoans+52 moreShow fewer
LoanStatements, CreditCards, Files, Queues, Reports, Simulations, Marketplaces, MarketplaceUsers, Merchants, MerchantCustomers, Orders, CustomerPaymentSources, TemporaryPaymentSources, PaymentTokens, PayPlanOffers, PayCards, PayPlans, PayToAgreements, Refunds, MerchantServiceTokens, MarketplaceServiceTokens, EnterpriseServiceTokens, SourceVerifications, SystemJournals, SystemJournalEntries, SystemLedgers, SystemLedgerEntries, Transactions, IssuerTransactions, IssuerTransactionDiscrepancies, WebhookMerchantSubscriptions, WebhookMarketplaceSubscriptions, WebhookSubscriptions, Sessions, ServiceTokens, ReferenceData, Users, Roles, OidcIdps, ReportsAcquiring, ReportsLending, ReportsIssuing, ReportsCustomers, ReportsOperations, ReportsOversight, Organisations, Persons, Suppliers, Rules, MerchantStatementPasswords, MerchantTravelData, Unknown
actionsarray of PermissionActionThe actions this grant allows on the resource.
CreateReadUpdateDeleteReadPiiReadAllCreateBillingPaymentSourceReadBillingPaymentSourceUpdateBillingPaymentSourceDeleteBillingPaymentSource+38 moreShow fewer
CreateFinancials, ReadFinancials, SearchFinancials, UpdateFinancials, DeleteFinancials, CreateKyb, ReadKyb, UpdateKyb, DeleteKyb, CreatePaymentProfiles, ReadPaymentProfiles, UpdatePaymentProfiles, DeletePaymentProfiles, CreatePermissions, ReadPermissions, UpdatePermissions, DeletePermissions, CreateState, ReadState, UpdateState, DeleteState, Activate, ActivatePaymentProfile, Apply, CreateUatp, Impersonate, Link, Orchestrate, Pay, Search, Simulate, SpecifySurcharge, Transfer, Upsert, UpsertMinimal, UpsertPlugin, Verify, Unknown
curl -X POST https://api.tst.au.apgpay.dev/roles \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "RoleCmdCreate",
"name": "Ada Lovelace",
"ownerDomain": {
"type": "UserDomainAnonymous",
"restrictedTo": {
"type": "UserDomainCustomer",
"customerId": "cust_9f2Kd8QpLzXw"
}
},
"grants": [
{
"type": "RoleGrantAttributes",
"resource": "BlockedCard",
"actions": [
"Create"
]
}
]
}'Responses
The response is a tagged shape: type is always "RoleCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.
typetype = "RoleCreateRspAttributes"The resource that was created.
typeA role the platform defines, carrying its own grants and available everywhere.
roleIdRoleIdrequiredIdentifier of a role.
Example role_9f2Kd8QpLzXw
namestringrequiredExample Ada Lovelace
The grants this role carries.
typeenumrequiredRoleGrantAttributesresourcePermissionResourcerequiredThe resource this grant is over.
BlockedCardCustomerDelegatesDisputesEnterprisesFxRatesLoanFacilitiesLoanProductsLoanTransactionsLoanMasterAgreementsLoans+52 moreShow fewer
LoanStatements, CreditCards, Files, Queues, Reports, Simulations, Marketplaces, MarketplaceUsers, Merchants, MerchantCustomers, Orders, CustomerPaymentSources, TemporaryPaymentSources, PaymentTokens, PayPlanOffers, PayCards, PayPlans, PayToAgreements, Refunds, MerchantServiceTokens, MarketplaceServiceTokens, EnterpriseServiceTokens, SourceVerifications, SystemJournals, SystemJournalEntries, SystemLedgers, SystemLedgerEntries, Transactions, IssuerTransactions, IssuerTransactionDiscrepancies, WebhookMerchantSubscriptions, WebhookMarketplaceSubscriptions, WebhookSubscriptions, Sessions, ServiceTokens, ReferenceData, Users, Roles, OidcIdps, ReportsAcquiring, ReportsLending, ReportsIssuing, ReportsCustomers, ReportsOperations, ReportsOversight, Organisations, Persons, Suppliers, Rules, MerchantStatementPasswords, MerchantTravelData, Unknown
actionsarray of PermissionActionThe actions this grant allows on the resource.
CreateReadUpdateDeleteReadPiiReadAllCreateBillingPaymentSourceReadBillingPaymentSourceUpdateBillingPaymentSourceDeleteBillingPaymentSource+38 moreShow fewer
CreateFinancials, ReadFinancials, SearchFinancials, UpdateFinancials, DeleteFinancials, CreateKyb, ReadKyb, UpdateKyb, DeleteKyb, CreatePaymentProfiles, ReadPaymentProfiles, UpdatePaymentProfiles, DeletePaymentProfiles, CreatePermissions, ReadPermissions, UpdatePermissions, DeletePermissions, CreateState, ReadState, UpdateState, DeleteState, Activate, ActivatePaymentProfile, Apply, CreateUatp, Impersonate, Link, Orchestrate, Pay, Search, Simulate, SpecifySurcharge, Transfer, Upsert, UpsertMinimal, UpsertPlugin, Verify, Unknown
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
A role a domain defines, carrying its own grants.
roleIdRoleIdrequiredIdentifier of a role.
Example role_9f2Kd8QpLzXw
namestringrequiredExample Ada Lovelace
The grants this role carries.
typeenumrequiredRoleGrantAttributesresourcePermissionResourcerequiredThe resource this grant is over.
BlockedCardCustomerDelegatesDisputesEnterprisesFxRatesLoanFacilitiesLoanProductsLoanTransactionsLoanMasterAgreementsLoans+52 moreShow fewer
LoanStatements, CreditCards, Files, Queues, Reports, Simulations, Marketplaces, MarketplaceUsers, Merchants, MerchantCustomers, Orders, CustomerPaymentSources, TemporaryPaymentSources, PaymentTokens, PayPlanOffers, PayCards, PayPlans, PayToAgreements, Refunds, MerchantServiceTokens, MarketplaceServiceTokens, EnterpriseServiceTokens, SourceVerifications, SystemJournals, SystemJournalEntries, SystemLedgers, SystemLedgerEntries, Transactions, IssuerTransactions, IssuerTransactionDiscrepancies, WebhookMerchantSubscriptions, WebhookMarketplaceSubscriptions, WebhookSubscriptions, Sessions, ServiceTokens, ReferenceData, Users, Roles, OidcIdps, ReportsAcquiring, ReportsLending, ReportsIssuing, ReportsCustomers, ReportsOperations, ReportsOversight, Organisations, Persons, Suppliers, Rules, MerchantStatementPasswords, MerchantTravelData, Unknown
actionsarray of PermissionActionThe actions this grant allows on the resource.
CreateReadUpdateDeleteReadPiiReadAllCreateBillingPaymentSourceReadBillingPaymentSourceUpdateBillingPaymentSourceDeleteBillingPaymentSource+38 moreShow fewer
CreateFinancials, ReadFinancials, SearchFinancials, UpdateFinancials, DeleteFinancials, CreateKyb, ReadKyb, UpdateKyb, DeleteKyb, CreatePaymentProfiles, ReadPaymentProfiles, UpdatePaymentProfiles, DeletePaymentProfiles, CreatePermissions, ReadPermissions, UpdatePermissions, DeletePermissions, CreateState, ReadState, UpdateState, DeleteState, Activate, ActivatePaymentProfile, Apply, CreateUatp, Impersonate, Link, Orchestrate, Pay, Search, Simulate, SpecifySurcharge, Transfer, Upsert, UpsertMinimal, UpsertPlugin, Verify, Unknown
The domain that owns this role.
typeAn 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.
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
A role that is the union of other roles.
roleIdRoleIdrequiredIdentifier of a role.
Example role_9f2Kd8QpLzXw
namestringrequiredExample Ada Lovelace
groupedRolesarray of RoleIdThe roles this one groups. Their grants are what it permits; read them to resolve it.
Example role_9f2Kd8QpLzXw
The domain that owns this role.
typeAn 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.
createdAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
updatedAtstring (date-time)requiredExample 2026-08-19T04:21:07Z
{
"type": "RoleCreateRspAttributes",
"created": {
"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
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"
}