PUT/projects/{project_id}/members/{member_id}/role

Set an organization member's project role

Sets or updates an organization's member's explicit role on a project. Provide role as viewer, editor, or admin to set the corresponding project permission. If the authenticated user is demoting themself, set confirm_self_demotion to true.

3 parameters · 1 body field
project_idstringrequired
The identifier of the project whose member role to set. Must contain 1 to 60 lowercase letters, digits, or hyphens.
member_idstringrequired
The UUID of the organization member whose project role to set.
confirm_self_demotionbooleanoptional
Set to true to confirm a role change that demotes the authenticated user.

The explicit project role to assign to the organization member.

rolestringrequired
Per-project role. `viewer` maps to `VIEWER`, `editor` maps to `EDITOR`, and `admin` maps to `ADMIN`.
Allowed:viewereditoradmin

2 status codes
200Returns the project and member identifiers, organization and project roles, effective project permissions when applicable, and credential-rotation recommendations when applicable.
project_idstringrequired
member_idstringrequired
user_idstringrequired
emailstringoptional
Email address of the user who has been granted access to the project.
namestringoptional
The user's display name.
org_rolestringrequired
Organization-level role used by project member role management.
Allowed:adminmembereditorviewercollaborator
project_rolestringoptional
Per-project role. `viewer` maps to `VIEWER`, `editor` maps to `EDITOR`, and `admin` maps to `ADMIN`.
Allowed:viewereditoradmin
org_default_project_permissionstringoptional
The caller's effective permission for a project when per-project permissions are enabled. `VIEWER` grants read access, `EDITOR` adds update access, and `ADMIN` grants full management. Omitted for personal projects, flag-off organizations, and non-user subjects.
Allowed:VIEWEREDITORADMIN
explicit_project_permissionstringoptional
The caller's effective permission for a project when per-project permissions are enabled. `VIEWER` grants read access, `EDITOR` adds update access, and `ADMIN` grants full management. Omitted for personal projects, flag-off organizations, and non-user subjects.
Allowed:VIEWEREDITORADMIN
effective_project_permissionstringoptional
The caller's effective permission for a project when per-project permissions are enabled. `VIEWER` grants read access, `EDITOR` adds update access, and `ADMIN` grants full management. Omitted for personal projects, flag-off organizations, and non-user subjects.
Allowed:VIEWEREDITORADMIN
credential_rotation_recommendedbooleanoptional
Hint that database credentials may need rotation after the role change.
org_api_key_rotation_recommendedbooleanoptional
Hint that project-scoped org API keys created by the target user may need rotation.
defaultGeneral Error. The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received. - If no response is returned from the API, a network error or timeout likely occurred. - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. Any request that returns a `503 Service Unavailable` response is always safe to retry. Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress.
request_idstringoptional
Unique identifier for the request, useful for debugging. You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.
codestringrequired
Machine-readable code classifying the error type. See `message` for a human-readable explanation.
Default:
messagestringrequired
Error message

Error handling

The project_id path parameter must contain 1 to 60 lowercase letters, digits, or hyphens, and the member_id path parameter must be a UUID. The role body field is required and must be viewer, editor, or admin. When the authenticated user is demoting themself, set the confirm_self_demotion query parameter to true.