Docs
Live demo
POST/api/v2/organizations/{id}/roles

Create a custom role: a name and permissions from the permission list. Every permission of the role must be a permission of the caller. An organization has at most 50 custom roles. Needs members:manage.

  • Max 50 custom roles (409 duplicate, 400 unknown permission, 403 role_exceeds_caller above caller permissions).
  • manage and access:apply imply their read prerequisites (jobs:read, targets:read, identities:read). Assign via PUT /organizations/{id}/memberships/{identity_id}.

Parameters

Path1 required of 1
idstringpathrequired

Organization ID (UUID)

Request body application/json · OrgCustomRoleRequest

Required2 of 3 fields
namestringrequired
max length 64
permissionsarray of string (OrgPermission)required

A manage or access:apply permission also brings the read permission of its area and jobs:read. Drift and applications permissions also bring targets:read, access:manage, access:apply and applications:manage also bring targets:read and identities:read.

access:applyaccess:manageaccess:readapplications:manageapplications:readaudit:readdrift:managedrift:readidentities:manageidentities:readjobs:managejobs:readmembers:managemembers:readnotifications:managenotifications:readorganization:readsecurity:managesecurity:readtargets:managetargets:readtokens:managetokens:read
min items 1
Optional1 field
descriptionstring
max length 500

Responses

201

Created

OrgCustomRoleResponse · 9 fields
idstring · uuidrequired
namestringrequired
descriptionstringrequired
permissionsarray of string (OrgPermission)required
access:applyaccess:manageaccess:readapplications:manageapplications:readaudit:readdrift:managedrift:readidentities:manageidentities:readjobs:managejobs:readmembers:managemembers:readnotifications:managenotifications:readorganization:readsecurity:managesecurity:readtargets:managetargets:readtokens:managetokens:read
membersintegerrequired

Members of the organization who hold the role on top of their built-in role.

groupsintegerrequired

Groups that give the role to their direct members.

tokensintegerrequired

Usable API tokens that hold the role.

created_atstring · date-timerequired
updated_atstring · date-timerequired
400

Bad Request: the name is empty or too long, or a permission is not in the permission list.

403

Forbidden: the caller lacks members:manage, or the role names permissions the caller does not have (details.reason=role_exceeds_caller, details.missing_permissions lists them).

404

Not Found: the organization, role or group does not exist or belongs to another organization.

409

Conflict: another role of the organization has this name, or the organization already has 50 custom roles.

Common errors: 401 413 429 503 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close