Delete User

Purpose

To delete a user from your organization.

Request Details

Request URL

{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
DELETE - Delete user data

Note
  • You can delete only one user per request.

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

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v3/users/554023000000691003"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v3/users/554023000000691003"
	type: DELETE
	connection:"crm_oauth_connection"
];
info response;

Possible Errors

  • INVALID_DATAHTTP 400

    the_id_given_seems_to_be_invalid
    Resolution: The record ID of the user you want to delete is invalid. Refer to Get Users API to get valid record IDs.

  • INVALID_REQUESTHTTP 400

    Primary contact cannot be deleted
    Resolution: You cannot delete the primary contact of your organization.

  • ID_ALREADY_DELETEDHTTP 400

    User is already deleted
    Resolution: The user you want to delete is already deleted.

  • AUTHORIZATION_FAILEDHTTP 400

    User does not have sufficient privilege to delete users
    Resolution: The user does not have the permission to delete users. 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.DELETE scope. Create a new client with valid scope. Refer to scope section above.

  • NO_PERMISSIONHTTP 403

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

Sample Response

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