Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

Update user or user group roles

PATCH {{baseUrl}}/workspaces/{{workspaceId}}/roles

Updates the roles of users or [user groups] in a workspace. To get a list of roles, use the [GET /workspace-roles] endpoint.

Include the following values in the roles array of objects:

  • op — (Required) A string value that contains the operation to perform. Accepts the add or remove value.

  • path — (Required) A string value that contains the resource to perform the action on. Accepts the /user or /usergroup value.

  • value — (Required) A list of objects that contain user or user group IDs and an assigned role ID.

    • id — (Required) A string value that contains the user or user group ID.
    • role — (Required) A number value that contains the workspace role's ID:

      • 1 — Viewer. Can view, fork, and export workspace resources
      • 2 — Editor. Can create and edit workspace resources.
      • 3 — Admin. Can manage workspace details and members.

Note:

  • This endpoint does not support the external [Partner or Guest roles]
  • This endpoint is restricted to 50 operations per call.
  • The request body must contain one unique action per user or user group. For example, you cannot add and remove multiple roles for a user in the same request body.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 




RESPONSES

status OK

{ "roles": [ { "id": 1, "displayName": "Viewer", "user": [ 12345678 ], "usergroup": [ 123 ] }, { "id": 2, "displayName": "Editor", "user": [ 87654321 ], "usergroup": [ 123 ] }, { "id": 3, "displayName": "Admin", "user": [ 13428756 ], "usergroup": [ 132 ] } ] }



Curl
curl -X PATCH 'https://api.getpostman.com/workspaces/workspaceId/roles'

ENDPOINTS