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
The fine-grained token must include the following permissions to access this endpoint:
- organization_admin_write
Path parameters
- slugRequiredstring
Organization slug
- user_idRequiredstring
Body
- dataRequiredobject
Response codes
- 200
- 401
- 402
- 403
- 429
- 500
Response (200)
{ "data": { "type": "organization_member_role", "attributes": { "name": "developer", "scope": "organization", "projects": [ { "ref": "lorem", "name": "lorem" } ] } }}