Users

Change a user's company role

This route allows you to promote or demote a user's company role.<br/><br/>Prerequisites:<br/>- The caller must have the Company admin role.<br/>- Machine tokens cannot call this route.<br/>- You cannot change your own role.<br/>- Both the caller and target must belong to the same company.<br/>- The last company admin cannot be demoted.<br/><br/>To learn more about multiple organization membership, check out the documentation.

patch/v1/users/{userId}/company-role

Request

  • Base URL: https://api.port.io
  • URL: https://api.port.io/v1/users/{userId}/company-role
  • Auth: API key in header Authorization

Path parameters

userIdstring required

The target user's ID, returned in the id field from Get all users in your organization or Get a user.

Request body

companyRole'ADMIN' | 'MEMBER' required

Use ADMIN to promote the user to company admin, or MEMBER to demote a company admin to member.

Response

Default Response

okboolean

Changes

No recorded changes to this operation across all 1 revision of this API.