Roles APIs
In Zoho CRM, Administrators assign roles to the users. Roles, such as Managers, Sales Reps, Supervisors, Product Management Staff, etc., denote the different levels of employees in a company. Use this API to retrieve information about various roles in Zoho CRM.
Get Roles
Purpose
To retrieve the details about roles in your organization.
Request Details
Request URL
{api-domain}/crm/{version}/settings/roles
To get 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
READ - Retrieve roles data
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v3/settings/roles"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Copiedresponse = invokeurl
[
url: "https://www.zohoapis.com/crm/v3/settings/roles"
type: GET
connection:"crm_oauth_connection"
];
info response;
Response JSON Keys
- display_labelstring
Represents the display name of the current role.
- share_with_peersboolean
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. - namestring
Represents the name of the current role.
- descriptionstring
Represents the description of the role, if any.
- idstring
Represents the unique ID of the role.
- reporting_toJSON object
Represents the name and ID of the roles which are higher to the current role in the role hierarchy.
Possible Errors
- INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have ZohoCRM.settings.roles.READ scope. Create a new client with valid scope. Refer to scope section above. - NO_PERMISSIONHTTP 403
Permission denied to read
Resolution: The user does not have permission to read roles data. Contact your system administrator. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team. - 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. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to read roles
Resolution: The user does not have the permission to retrieve roles data. Contact your system administrator.
Sample Response
Copied{
"roles": [
{
"display_label": "CEO",
"forecast_manager": {
"name": "Patricia Boyle",
"id": "4150868000000225013"
},
"share_with_peers": true,
"name": "CEO",
"description": "Users with this role have access to the data owned by all other users.",
"id": "4150868000000026005",
"reporting_to": null
},
{
"display_label": "Manager",
"forecast_manager": null,
"share_with_peers": false,
"name": "Manager",
"description": "Users belonging to this role cannot see data for admin users.",
"id": "4150868000000026008",
"reporting_to": {
"name": "Sales department Head",
"id": "4150868000000231921"
}
},
{
"display_label": "Sales rep",
"forecast_manager": null,
"share_with_peers": true,
"name": "Sales rep",
"description": "Lowest in the heirarchy",
"id": "4150868000000231917",
"reporting_to": {
"name": "Manager",
"id": "4150868000000026008"
}
},
{
"display_label": "Sales department Head",
"forecast_manager": null,
"share_with_peers": true,
"name": "Sales department Head",
"description": "Sales department head",
"id": "4150868000000231921",
"reporting_to": {
"name": "CEO",
"id": "4150868000000026005"
}
}
]
}