Delete a user

Delete a user from the organization.

Request URL

{api-domain}/bigin/v2/users/{user_id}

Choose domain-specific URL to replace {api-domain}

You can use the domain-specific URL to access Bigin resources. Based on the data center in which the Bigin account's resources are available, replace {api-domain} in the preceding request with one of the following API domain URLs:

  • For US, https://www.zohoapis.com
  • For EU, https://www.zohoapis.eu
  • For AU, https://www.zohoapis.com.au
  • For IN, https://www.zohoapis.in
  • For CN, https://www.zohoapis.com.cn
  • For JP, https://www.zohoapis.jp

For more information, see Multi DC Support.

 

Authorization

For this endpoint, pass the access token as an authorization header. See OAuth Authentication for more information about access tokens.

Authorization: Zoho-oauthtoken <ACCESS_TOKEN>

You must authenticate using an access token that is associated with one of the following scopes:

  • ZohoBigin.users.ALL
  • ZohoBigin.users.DELETE

Request parameters

The available request parameters are given below:

Path parameters

user_id stringRequired

The unique identification of a user. You can get the ID from the Get user data API.

Notes:

  • Only one user can be deleted per request.
  • When fetching user records through the Get Users API, the deleted user record will also appear in the response with the status value set to deleted.
  • The primary user of the organization cannot be directly deleted. To delete the primary user, you need to assign another user as the new primary contact for the organization and then delete the old one.

Sample request

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

Response object

The response object provides information regarding the success message or status.

Possible error codes

The response of this resource includes HTTP status and error codes.

The most common HTTP error codes that occur when you request access to this endpoint are given in the following:

  • INVALID_DATAHTTP 200

    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.

Sample response

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