Skip to content
Management API Reference

Assign or change an organization member role

patch/v2/organizations/{slug}/members/{user_id}/roles

Assigns 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

  • slug
    Required
    string

    Organization slug

  • user_id
    Required
    string

Body

  • data
    Required
    object

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"
}
]
}
}
}