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/v6/settings/roles/3652397000010189001"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v6/settings/roles/3652397000010189001"
	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.

  • created_by__sJSON object

    Represents the name and ID of the user that created this role.

  • modified_by__sJSON object

    Represents the name and ID of the user who modified this role last.

  • created_time__sDateTime in the ISO8601 format

    Represents the date and time at which the role was created.

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": "SalesRep",
            "created_by__s": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "modified_by__s": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "forecast_manager": null,
            "share_with_peers": true,
            "modified_time__s": "2022-11-10T17:25:02+05:30",
            "name": "SalesRep",
            "description": null,
            "reporting_to": {
                "name": "Manager",
                "id": "3652397000000026008"
            },
            "id": "3652397000010189001",
            "created_time__s": "2022-11-10T17:25:02+05:30"
        }
    ]
}