Update Role

Purpose

To update the details of a role in your organization.

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/v5/settings/roles"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Request JSON Keys

  • 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

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have ZohoCRM.settings.roles.UPDATE scope. Create a new client with valid scope. Refer to scope section above.

  • NO_PERMISSIONHTTP 403

    Permission denied to update
    Resolution: The user does not have permission to update 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 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.

Sample Response

Copied{
    "code": "SUCCESS",
    "details": {
        "id": "4150868000000231921"
    },
    "message": "Role updated",
    "status": "success"
}