HTTP Method | URL | Requires Auth |
---|---|---|
POST | /api/v1/roles.update | yes |
Key | Example Value | Description |
---|---|---|
roleId * | 646c431fa8c3a3ba32d0e1c4 | The role ID that you want to update. |
name * | newRole | The updated name of the role. |
scope | Subscriptions | The updated scope of the role. The default value is Users . |
description | Role description | Updated description for the role. |
mandatory2fa | true | Whether the role should have a mandatory 2FA. The default value is false . |
curl --location 'http://localhost:3000/api/v1/roles.update' \
--header 'X-User-Id: rbAXPnMktTFbNpwtJ' \
--header 'X-Auth-Token: 3K3OqbQcU9H6FiZNEE5lxTTEfXyWxypWRJjvl_2ySOm' \
--header 'Content-Type: application/json' \
--data '{
"roleId": "646c431fa8c3a3ba32d0e1c4",
"name": "Test Role",
"scope": "Users",
"description": "Testing Role for API",
"mandatory2fa": false
}'
{
"role": {
"_id": "646c431fa8c3a3ba32d0e1c4",
"name": "update role",
"scope": "Users",
"description": "Update Role support tier 1",
"protected": false,
"mandatory2fa": false,
"_updatedAt": "2023-05-23T05:33:33.730Z"
},
"success": true
}
Any of the following errors can occur:
- Authorization: Requires an authentication token for the request to be made.
- Invalid Role Properties: Occurs when the required payload arguments are not provided when making the request.
{% tabs %} {% tab title=" Authorization" %}
{
"success": false,
"error": "unauthorized"
}
{% endtab %}
{% tab title="Invalid Role Properties" %}
{
"success": false,
"error": "The role properties are invalid. [error-invalid-role-properties]",
"errorType": "error-invalid-role-properties"
}
{% endtab %} {% endtabs %}
Version | Description |
---|---|
6.0.0 | Moved to enterprise edition. |