API v1
ยท
REST ยท JSON
Blastifi API
A simple REST API that lets you add and manage WhatsApp contacts in Blastifi directly from your store, app, or any external system โ no manual login needed.
๐ You need an API key to get started. Create one from your API Dashboard.
Base URL: https://blastifi.com/api/v1
Authentication
Send your API key in every request via HTTP header:
HTTP Header
Authorization: Bearer blastifi_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Error Codes
| Code | Error | Description |
|---|---|---|
401 | Unauthorized | Invalid or missing API key |
403 | plan_limit_reached | Plan contact limit exceeded โ upgrade at /app/billing |
400 | validation_error | Missing or invalid data |
404 | not_found | Contact not found |
405 | method_not_allowed | HTTP method not supported |
POST /contacts
Add a single contact:
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | Contact name |
| phone | string | required | Digits only without + (962799123456) |
| group | string | optional | Group name (default: API) |
| notes | string | optional | Notes |
| tags | array | optional | Tags array |
curl
curl -X POST https://blastifi.com/api/v1/contacts \
-H "Authorization: Bearer blastifi_live_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Ahmed Mohammed",
"phone": "962799123456",
"group": "Store Customers",
"tags": ["new", "vip"]
}'
Response 201
{
"ok": true,
"added": 1,
"errors": 0,
"contacts": [{"id": 42, "name": "Ahmed Mohammed", "phone": "962799123456", "group": "Store Customers"}],
"failed": null
}
POST /contacts (batch)
Add multiple contacts in a single request using the contacts array:
curl
curl -X POST https://blastifi.com/api/v1/contacts \
-H "Authorization: Bearer blastifi_live_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
{"name": "Ahmed", "phone": "962799111111", "group": "Batch"},
{"name": "Sara", "phone": "962799222222", "group": "Batch"},
{"name": "Omar", "phone": "962799333333", "group": "Batch"}
]
}'
GET /contacts
Fetch contacts list with pagination and filtering:
| Param | Type | Default | Description |
|---|---|---|---|
| limit | int | 50 | Results per page (max 100) |
| offset | int | 0 | For pagination |
| group | string | - | Filter by group name |
curl
curl "https://blastifi.com/api/v1/contacts?limit=10&offset=0&group=Store+Customers" \
-H "Authorization: Bearer blastifi_live_YOUR_TOKEN"
DELETE /contacts?id={id}
curl
curl -X DELETE "https://blastifi.com/api/v1/contacts?id=42" \
-H "Authorization: Bearer blastifi_live_YOUR_TOKEN"
PHP
PHP
<?php
$token = "blastifi_live_YOUR_TOKEN";
$ch = curl_init("https://blastifi.com/api/v1/contacts");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . $token,
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Ahmed",
"phone" => "962799123456",
"group" => "WooCommerce",
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($response["ok"]) {
echo "Added contact ID: " . $response["contacts"][0]["id"];
}
JavaScript (fetch)
JavaScript
const res = await fetch('https://blastifi.com/api/v1/contacts', {
method: 'POST',
headers: {
'Authorization': 'Bearer blastifi_live_YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Ahmed',
phone: '962799123456',
group: 'Website Leads',
}),
});
const data = await res.json();
console.log('Added:', data.contacts[0].id);
Python
Python
import requests
TOKEN = "blastifi_live_YOUR_TOKEN"
URL = "https://blastifi.com/api/v1/contacts"
response = requests.post(URL,
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"name": "Ahmed",
"phone": "962799123456",
"group": "Python Script",
}
)
data = response.json()
print(f"Added ID: {data['contacts'][0]['id']}")
Zapier โ Auto-add from any app
Use "Webhooks by Zapier" as an Action to add contacts from Shopify, WooCommerce, Google Forms, or any other app:
Action: Webhooks by Zapier โ Custom Request
Method: POST
URL:
https://blastifi.com/api/v1/contactsHeaders:
Authorization: Bearer blastifi_live_YOUR_TOKENData:
{"name": "{{Customer Name}}", "phone": "{{Phone}}", "group": "Zapier"}
๐ก Make sure phone is digits only without + or spaces โ use Zapier Formatter to clean it if needed