Skip to content

Update role

Request to update existing role:

PUT /api/v2/roles/<role-id>.json

HTTP body should contain JSON formatted profile of role to update.

For example:

{
    "role": {
        "name": "Supervisor Role",
        "tenant_id": "e00a4822-f288-11e4-b559-e03f497dbdff",
        "permissions": {
            "system": [],
            "users": ["view"],
            "calls": ["view", "categorize", "on_demand_trigger"],
        }
    }
}

Response contains HTTP status code as shown in the following table.

Response Description
200 OK Role has been successfully updated
403 Forbidden The request cannot be completed because API user has no permission to edit roles
400 Bad Request

The request cannot be completed because supplied JSON object has invalid data.

When response has content type application/json, then it contains more detailed description of error in JSON format like:

{"error": "InvalidRecord","description": "Record Validation errors","details": ["name": "Role with such name exists already"]}