Edit User Roles

There are two ways of editing an existing user role

📘

Go to Create User Roles for reference on properties

Refer to the Create User Roles page to see the required and allowed properties to perform these operations.

1. Edit the user role by providing only the properties that need to be updated

PATCH: /api/v3/userroles//

$ curl -X PATCH \
  https://www.zenput.com/api/v3/userroles/<userrole-id>/ \
    -H 'content-type: application/json' \
  -H 'X-API-TOKEN: your-api-token-goes-here' \
  -d '{
  "name": "User role name"
}'

2. Replace the entire team

PUT: /api/v3/userroles//

$ curl -X PUT \
  https://www.zenput.com/api/v3/userroles/<userrole-id>/ \
    -H 'content-type: application/json' \
  -H 'X-API-TOKEN: your-api-token-goes-here' \
  -d '{
    "name": "User role name",
    "parent_role": {
        "id": 1
    },
    "default_permission": {
        "id": 3
    }
}'

❗️

Don't forget the trailing slash!

Both PUT and PATCH requests need to have a trailing slash on the URL.