Update Role
Purpose
To update the details of a role in your organization.
- PUT /settings/roles
- PUT /settings/roles/{role_ID}
Request Details
Request URL
{api-domain}/crm/{version}/settings/roles
To update a specific role:
{api-domain}/crm/{version}/settings/roles/{role_ID}
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.roles.{operation_type}
Possible operation types
ALL - Full access to roles data
UPDATE - Update roles data
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/roles"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Request JSON
- idstring, mandatory if not specified in request URL
Represents the unique ID of the role to be updated.
- namestring, optional
Represents the display name of the role.
- reporting_tostring, optional
Represents the unique ID of the role which is higher to the current role in the role hierarchy.
- descriptionstring, optional
Represents the description of the role, if any.
- share_with_peersBoolean, optional
Represents if the users with the current role have the permission to share records.
Possible values:
true: The users with the current role can share records with other users.
false: The users with the current role cannot share records with other users. - forecast_managerstring, optional
Represents the forecast manager's unique ID. This applies only when forecast management is based on a role hierarchy.
Sample Input
Copied{
"roles": [
{
"id": "4150868000000231921",
"name": "Sales department Head",
"reporting_to": "4150868000000026005",
"forecast_manager": "738964000000291009",
"description": "Manage the sales department",
"share_with_peers": true
}
]
}
Possible Errors
- INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above at the beginning of this page. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to update roles
Resolution: The user does not have the permission to update. Contact your system administrator. - INVALID_DATAHTTP 400
The id given seems to be invalid
Resolution: The role ID specified in the reporting_to key is invalid. Specify valid role ID. - INVALID_DATAHTTP 400
Invalid data
Resolution: You can update only a single role through an API call. - INVALID_DATAHTTP 400
The given role id seems invalid
Resolution: The role ID specified in the request input is invalid or is deleted. Specify valid role ID. - DUPLICATE_DATAHTTP 400
Failed to add role since role with same name is already exist
Resolution: Specify a unique role name in the request input. - MANDATORY_NOT_FOUNDHTTP 400
Required field not found
Resolution: Specify the unique ID of the role to be updated in the request input. - OAUTH_SCOPE_MISMATCHHTTP 401
The access token you have used to make this API call does not have the required scope.
Resolution: Generate a new access token with the required scopes for this API. Refer to the Scope section at the beginning of this page for the list of required scopes. - NO_PERMISSIONHTTP 403
Permission denied to update
Resolution: The user does not have permission to update roles data. Contact your system administrator. - INVALID_URL_PATTERNHTTP 404
The request URL is incorrect.
Resolution: Specify a valid request URL. Refer to the Request URL section at the beginning of this page for more details. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team.
Sample Response
Copied{
"code": "SUCCESS",
"details": {
"id": "4150868000000231921"
},
"message": "Role updated",
"status": "success"
}