Assign or change an organization member role
patch
/v2/organizations/{slug}/members/{user_id}/rolesAssigns an org-wide role when projects is omitted, or creates a project-scoped assignment when projects is provided. Uses an org-level role template id from GET /v2/organizations/{slug}/roles. Stale role assignments are automatically cleaned up: if a role no longer has any projects, it is deleted; overlapping project assignments in other roles are automatically removed to avoid duplication.
This endpoint is only available on the following plans:
- Enterprise
Path parameters
- slugRequiredstring
Organization slug
- user_idRequiredstring
Body
- dataRequiredobject
Response codes
- 200
- 401
- 402
- 403
- 429
- 500
Response (200)
1{2 "data": {3 "type": "organization_member_role",4 "attributes": {5 "name": "developer",6 "scope": "organization",7 "projects": [8 {9 "ref": "lorem",10 "name": "lorem"11 }12 ]13 }14 }15}