Skip to content
API Reference

Role assignment

Role assignment in the Paycux API: the endpoints, the fields they accept and return, and a working request in three languages.

Overview

The Role assignment resource is part of the Paycux API. Every field below is returned on every representation of the object, so you can rely on its shape across list, read and write calls.

FieldTypeNotes
idstringStable identifier, prefixed per resource type.
objectstringThe resource name, useful when handling webhook payloads.
created_attimestampISO 8601, always UTC.
updated_attimestampISO 8601, always UTC.

Endpoints

Every endpoint is authenticated with a bearer token and scoped to the environment the key belongs to.

MethodPathWhat it does
GET/authorization/organization_memberships/:organization_membership_id/role_assignmentsList role assignments
DELETE/authorization/organization_memberships/:organization_membership_id/role_assignments/:role_assignment_idRemove a role assignment by ID
GET/authorization/organizations/:organization_id/resources/:resource_type_slug/:external_id/role_assignmentsList role assignments for a resource by external ID
GET/authorization/resources/:resource_id/role_assignmentsList role assignments for a resource

List role assignments

GET /authorization/organization_memberships/:organization_membership_id/role_assignments — list role assignments.

1import Paycux from '@paycux/node';
2
3const paycux = new Paycux(process.env.PAYCUX_API_KEY);
4
5const result = await paycux.list_role_assignments();
6console.log(result);

Remove a role assignment by ID

DELETE /authorization/organization_memberships/:organization_membership_id/role_assignments/:role_assignment_id — remove a role assignment by ID.

1import Paycux from '@paycux/node';
2
3const paycux = new Paycux(process.env.PAYCUX_API_KEY);
4
5const result = await paycux.remove_a_role_assignment_by_id();
6console.log(result);

List role assignments for a resource by external ID

GET /authorization/organizations/:organization_id/resources/:resource_type_slug/:external_id/role_assignments — list role assignments for a resource by external ID.

1import Paycux from '@paycux/node';
2
3const paycux = new Paycux(process.env.PAYCUX_API_KEY);
4
5const result = await paycux.list_role_assignments_for_a_resource_by_external_id();
6console.log(result);

List role assignments for a resource

GET /authorization/resources/:resource_id/role_assignments — list role assignments for a resource.

1import Paycux from '@paycux/node';
2
3const paycux = new Paycux(process.env.PAYCUX_API_KEY);
4
5const result = await paycux.list_role_assignments_for_a_resource();
6console.log(result);

Errors

Errors return a JSON body with a machine-readable code, a human-readable message and, for validation failures, the offending field.

StatusCodeMeaning
400invalid_requestA required field is missing or malformed.
401unauthorizedThe API key is missing, revoked, or from another environment.
404not_foundNo record with that ID in this environment.
429rate_limit_exceededBack off and retry after the interval in Retry-After.