Create Role
Purpose
To add a new role to your organization.
Endpoints
- POST /settings/roles
Request Details
Request URL
{api-domain}/crm/{version}/settings/roles
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.roles.{operation_type}
Possible operation types
ALL - Full access to roles data
CREATE - Create roles data
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/roles"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"Request JSON
- namestring, mandatoryRepresents the display name of the role. 
- reporting_tostring, optionalRepresents the unique ID of the role which is higher to the current role in the role hierarchy. 
- descriptionstring, optionalRepresents the description of the role, if any. 
- share_with_peersBoolean, optionalRepresents if the users with the current role have the permission to share records. 
 Possible values
 false: The users with the current role cannot share records with other users. This is the default value.
 true: The users with the current role can share records with other users.
Sample Input
Copied{
    "roles": [
        {
            "name": "Product Manager",
            "reporting_to": "4150868000000225013",
            "description": "Schedule and manage resources",
            "share_with_peers": true
        }
    ]
}Possible Errors
- INVALID_REQUEST_METHODHTTP 400The 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 at the beginning of this page.
- AUTHORIZATION_FAILEDHTTP 400User does not have sufficient privilege to read roles 
 Resolution: The user does not have the permission to retrieve roles data. Contact your system administrator.
- INVALID_DATAHTTP 400The ID given seems to be invalid or already deleted 
 Resolution: The role ID specified in the request input is invalid. Specify valid role ID.
- INVALID_DATAHTTP 400Role name should not contain the following special character(s):# 
 Resolution: The role name must not contain any special characters. Specify a valid role name.
- DUPLICATE_DATAHTTP 400Failed to add role since role with same name is already exist 
 Resolution: Specify unique role name in the request input.
- MANDATORY_NOT_FOUNDHTTP 400The required field not found 
 Resolution: Specify the name of the role in the request input.
- LICENSE_LIMIT_EXCEEDEDHTTP 400Request exceeds your license limit 
 Resolution: Contact your administrator.
- OAUTH_SCOPE_MISMATCHHTTP 401The 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 403Permission denied to read 
 Resolution: The user does not have permission to read roles data. Contact your system administrator.
- INVALID_URL_PATTERNHTTP 404The request URL is incorrect 
 Resolution: Specify a valid request URL. Refer to Request URL section at the beginning of this page for more details.
- INTERNAL_ERRORHTTP 500Internal Server Error 
 Resolution: Unexpected and unhandled exception in Server. Contact support team.
Sample Response
Copied{
    "roles": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "5843104000002870001"
            },
            "message": "Role added",
            "status": "success"
        }
    ]
}