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

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)

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
}