Delete Contact Group

DELETE/api/v2/contact-groups/delete

Base URL https://api.easify.liveBearer token and Accept header required Authentication →

This endpoint is used to delete a contact group.

The user can delete a specific contact group from the database using the group ID

Warning: Deleting a contact group also permanently deletes every contact in that group. If the group was shared with sub-users, it is removed for them as well.

There is a rate limit of 60 requests per minute per API token. This limit is shared by all API endpoints except those with their own separate limit (/api/v2/sms/send, /api/v3/sms/send, etc.), so requests to other endpoints also count toward it. If you exceed this limit, you will receive a 429 Too Many Requests status, along with a message indicating when you can try again.

Query Parameters

group_id integer The specific contact group ID for update (Thegroup ID will be obtained from the contact-groups API response) required

Example Request and Response

Params:

{
  "group_id": 1
}

Success Response:

{
  "status": true,
  "message": "Contact Group deleted successfully",
  "data": []
}

Responses

Case Status Code Response
If the user does not provide a token in the header or provides an invalid token 401 { "status":false,
"message":"Unauthenticated",
"errors":[] }
If user did not provide the group_id 422 { "message": "The group id field is required.", "errors": { group_id": "The group id field is required."] } }
If user did not provide invalid group_id 400 { "status": false, "message": "Invalid group id", "errors": [] }
If a user tries to delete the default contact group. 400 { "status": false, "message": "You can't delete the default contact group!", "errors": [] }
If the user exceeds the allowed rate limit for requests 429 { "status":false, "message":"Too many requests. Try again in 59 seconds", "errors":[] }
If the user's subscription has ended 402 { "status":false,"message":"You need to recharge your account to proceed","errors":[] }
When the user account is inactive 403 { "status": false, "message": "Your account is currently inactive.", "errors": [] }
If the request comes from an IP address or domain that is not on the account's API whitelist 400 { "status": false, "message": "Access denied! Your IP or domain is not whitelisted.[ HostName : ] - [ Ip Address : << YOUR_SERVER_IP >>]", "errors": [] }

Code Examples

Delete a contact group
php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.easify.live/api/v2/contact-groups/delete?group_id=1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <>',
    'Accept: application/json',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;