Update User

Purpose

To update the details of a user of your organization.

Request Details

Request URL

{api-domain}/crm/{version}/users

To update a specific user
{api-domain}/crm/{version}/users/{user_id}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.users.{operation_type}

Possible operation types

ALL - Full access to users
UPDATE - Update user data

Note

You can update only one user's details per PUT request.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v3/users"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@updateuser.json"
-X PUT
Copieduser1 = Map();
user1.put("id", "692969000000282009");
user1.put("last_name", "B");

users_list = List();
users_list.add(user1);

params = Map();
params.put("users", users_list);

response = invokeurl
[
	url: "https://www.zohoapis.com/crm/v3/users"
	type: PUT
	parameters: params.toString()
	connection:"crm_connection"
];
info response ;

In the request, "@updateuser.json" contains the sample input data.

Request JSON
  • idstring, mandatory

    Specify the record ID of the user you want to update.

Note
  • You can also pass the record ID in the request. Example: {api-domain}/crm/v3/users/{record_id}

  • Refer to Get User API to obtain the record ID of the user.

  • You cannot update a deactivated user.

  • You cannot deactivate the primary contact of your organization. To deactivate the primary contact, you must assign another user as the new primary contact of your organization and then deactivate the old primary contact.

  • To activate or deactivate a user, use the key status in the input with the value as either active or inactive, respectively.

  • You cannot change the time zone of another user. You can only change the time zone of your own user record. Refer to Fields Metadata API to know the values of the key "time_zone".

  • You must use only Field API names in the input. You can obtain the field API names from Fields metadata API (the value for the key “api_name” for every field).

  • Refer to Add Records API to know about the field types and their limitations.

Sample Input

Copied{
  "users": [
    {
      "id": "554023000000691003",
      "phone": "123456789",
      "email": "newtocrm@zoho.com",
      "dob": "1990-12-31",
      "role":"79234000000031154",
      "profile":"79234000000031157",
      "country_locale": "en_US",
      "time_format": "HH:mm",
      "time_zone": "US/Samoa",
      "status": "active"
    }
  ]
}

Possible Errors

  • INVALID_DATAHTTP 400

    Cannot update the time_zone of another user
    Resolution: You cannot update the time zone of another user.

  • AUTHORIZATION_FAILEDHTTP 400

    Either trial has expired or user does not have sufficient privilege to perform this action
    Resolution: Contact your system administrator.

  • INTERNAL_ERRORHTTP 400

    Error occurred while updating CRM Plus User in CRM Account
    Resolution: You cannot update a CRM Plus user from your CRM account.

  • INVALID_DATAHTTP 400

    Invalid data
    Resolution: The input you have specified is invalid

  • INVALID_DATAHTTP 400

    Invalid data
    Resolution: Unclosed Script tags found in signature. Specify valid script tags

  • CANNOT_UPDATE_DELETED_USERHTTP 400

    Deleted user cannot be updated
    Resolution: You cannot update a deleted user.

  • INVALID_REQUESTHTTP 400

    Re-invite is not allowed for a confirmed user
    Resolution: You cannot re-invite a confirmed user.

  • EMAIL_UPDATE_NOT_ALLOWEDHTTP 400

    Cannot update email of a confirmed CRM User
    Resolution: You cannot update the email of a confirmed user.

  • DUPLICATE_DATAHTTP 400

    User with same email id is already in CRM Plus
    Resolution: You are trying to specify a duplicate value for a unique field. Ensure that you specify unique and valid email IDs for all the users.

  • ID_ALREADY_DEACTIVATEDHTTP 400

    User is already deactivated
    Resolution: The user you are trying to deactivate is already deactivated.

  • INVALID_REQUESTHTTP 400

    Primary Contact cannot be deactivated
    Resolution: You cannot deactivate a primary contact.

  • ID_ALREADY_ACTIVEHTTP 400

    User is already active
    Resolution: The user you are trying to activate is already active.

  • FEATURE_PERMISSIONHTTP 400

    Share among Subordinates Feature is not available
    Resolution: The share among the subordinated feature is not available for your account. Contact your system administrator.

  • AUTHORIZATION_FAILEDHTTP 405

    Profile and Role cannot be Updated by the user
    Resolution: The current user does not have permission to update the profile and role of another user. Contact your system administrator.

  • 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.users.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 users. Contact your system administrator.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in the 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.

  • MANDATORY_NOT_FOUNDHTTP 400

    required field not found
    Resolution: You have not specified the unique ID of the user to be updated in your request. Specify the unique ID of the user.

Sample Response

Copied{
  "users": [
    {
      "code": "SUCCESS",
      "details": {
        "id": "554023000000691003"
      },
      "message": "User updated",
      "status": "success"
    }
  ]
}