Import Blacklist Contacts
POST
/api/v3/blacklist-contacts/import Base URL https://api.easify.liveBearer token and Accept header required Authentication →
The endpoint allows users to add numbers to the blacklist.
There is a rate limit of 15 requests per minute per API token. This count is shared by all API endpoints, including GET requests, except those with their own separate limit (/api/v2/sms/send, /api/v3/sms/send, etc.), so this endpoint is refused once your token has made 15 requests to the shared endpoints within a minute. If you exceed this limit, you will receive a 429 Too Many Requests status, along with a message indicating when you can try again.
The import process will run in the background. You can check its status using the blacklist-contacts/import/details API.
Request Body
| file file |
CSV File containing numbers to be blacklisted (Max Size: 2MB) Download Sample File |
Required |
Example Request and Response
{
"status": true,
"message": "Blacklist Contact import on progress",
"data": {
"id": 1,
"file_name": "blacklist-contacts.csv",
"status": "In Progress",
"progress_percentage": 0,
"total_count": 10000,
"skipped_count": 0,
"stored_count": 0,
"created_at": "07-22-2025 04:48:11 AM"
}
}
Responses
| Case | Status Code | Response |
|---|---|---|
| If the user provides an invalid Easify API token or does not pass the Easify API token in the header. | 401 |
{
"status":false,
"message":"Unauthenticated",
"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":[]
}
|
| If the uploaded file not a valid CSV file | 422 |
{
"message": "The file field must be a file of type: text/csv, text/plain",
"errors": {
"file": [
"The file field must be a file of type: text/csv, text/plain."
]
}
}
|
| If the uploaded file size exceeds 2MB | 422 |
{
"message": "The file field must not be greater than 2048 kilobytes.",
"errors": {
"file": [
"The file field must not be greater than 2048 kilobytes."
]
}
}
|
| If the uploaded file doesn't follow the structure of the sample file. | 400 |
{
"status": false,
"message": "Failed to import Blacklist contacts. Please check the CSV file and try again.",
"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
Import blacklist contacts
php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.easify.live/api/v3/blacklist-contacts/import',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
// Sent as multipart/form-data, not JSON.
CURLOPT_POSTFIELDS => [
'file' => new CURLFile('blacklist-contacts.csv', 'text/csv', 'blacklist-contacts.csv'),
],
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <> ',
'Accept: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;