PUT/v2/organizations/{organizationId}/users/{userId}/set-role

Set a user's organization role

Sets a user's role in an organization. Provide roleType with one of the supported role values: MEMBER, OWNER, or MAINTAINER. Use the organization and user identifiers to specify whose role to change.

2 parameters · 1 body field
organizationIdintegerrequired
The integer identifier of the organization where the user's role is set.
userIdintegerrequired
The integer identifier of the user whose organization role to set.

The organization role to assign to the user.

roleTypestringrequired
The role to assign: `MEMBER`, `OWNER`, or `MAINTAINER`.
Allowed:MEMBEROWNERMAINTAINER

5 status codes
200Returns confirmation that the user's organization role was set.
400Returned when `roleType` is missing or does not match an accepted role value.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is not authenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user is not permitted to change the user's role.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the organization or user cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when roleType is missing or is not one of MEMBER, OWNER, or MAINTAINER. A 401 is returned when the request is not authenticated, and a 403 when the authenticated user cannot change the user's role. A 404 is returned when the organization or user cannot be found. The organizationId path parameter and userId path parameter identify the organization and user.