API Documentation
Connect your WhatsApp number to your own software.
Getting Started
All requests are made to the address below. Replace {number} with the WhatsApp number registered in your Control Panel, including the country code and without a leading +.
https://www.wapifly.com/api/{number}/...Authentication
Send your API key in the wapikey header with every request. You can find your API key under Control Panel > Settings.
| Header | Description |
|---|---|
wapikey required | Your 64-character API key. |
Content-Type | application/json for requests with a body. |
Accept-Language | Language of response messages: tr or en. |
IP whitelist
The API only accepts requests from IP addresses you have allowed in the Control Panel. Requests from other IPs are rejected with errCode: 108 and the response shows the IP the request came from.
Response format
All responses are JSON. Successful responses contain "status": "ok"; errors contain "status": "fail" with an errCode and a message.
{
"status": "fail",
"errCode": 102,
"message": "Your WhatsApp number or API key is incorrect!"
}How Sending Works
Sending is asynchronous:
- Optional: use Check Contact to verify that numbers are registered on WhatsApp.
- A Send Message request queues the job and immediately returns an
id. At this point"status": "ok"only means the request was accepted. - Messages are sent one by one in the background at the
intervalyou set. Numbers that are unregistered, invalid or blacklisted are marked as failed at this stage. - Call Message Status with the
idto get the result and failure reason for each number.
Service Status
Shows whether your WhatsApp session is connected and ready to send messages. Use it as a check before sending.
Parameters
This service takes no parameters.
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/status" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/status",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/status");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/status", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Service is running
{
"status": "ok",
"message": "Hizmetiniz çalışıyor.",
"state": "ready",
"isReady": true,
"lastActivity": "2026-10-14T12:42:10.000Z"
}200Service is not running
{
"status": "fail",
"message": "Hizmetiniz çalışmıyor.",
"state": "disconnected",
"isReady": false,
"lastActivity": "2026-10-14T12:42:10.000Z"
}500Session not found
{
"status": "fail",
"errCode": 110,
"message": "Yeniden QR kod okutmalısınız."
}state values
ready | Connected, messages can be sent. |
initializing | Session is starting. |
connecting | Connecting to WhatsApp. |
authenticated | Logged in, getting ready. |
qr_ready | Waiting for QR scan. Scan the QR code from the Control Panel. |
disconnected | Disconnected. Try reconnecting with Repair Service. |
failed | Session failed to start. |
Repair Service
Reconnects a disconnected WhatsApp session. Does nothing if the service is already running. If the session has been closed entirely it cannot be repaired; scan the QR code again from the Control Panel.
Parameters
This service takes no parameters.
Example request
curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/repair" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.post(
"https://www.wapifly.com/api/905XXXXXXXXX/repair",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/repair");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/repair", {
method: "POST",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Repaired
{
"status": "ok",
"message": "Hizmetiniz başarıyla onarıldı."
}200Service already running
{
"status": "ok",
"message": "Hizmetiniz çalışıyor."
}401QR code must be scanned again
{
"status": "fail",
"errCode": 109,
"message": "Hizmet onarımı başarısız oldu. Yeniden QR kod okutmalısınız."
}ready.Send Message
Sends a text, image, document, audio or video message to one or more numbers (or a WhatsApp channel). The request queues the job and immediately returns a job ID; messages are sent one by one in the background at the interval you set. Call Message Status with the returned ID to get the result for each number.
Parameters
| Name | Type | Description |
|---|---|---|
type |
integer body |
Message type. 1 text (default), 2 image, 3 document, 4 audio, 5 video. Only types included in your plan can be used. |
numbersrequired |
string body |
Recipient numbers. Separate multiple numbers with commas or line breaks. Include the country code (e.g. 905321234567). Duplicates are sent once. Not needed when channel is used. |
message |
string body |
Message text. Required for type=1; sent as the caption for images, documents and videos; ignored for audio. Spintax is supported: {Hello|Hi}. |
url |
string body |
URL of the file to send. Required for type 2-5 and must start with https://. |
interval |
integer body |
Delay between two messages in seconds. Default and minimum is 1. |
channel |
string body |
Channel ID (...@newsletter) to send to a WhatsApp channel instead of numbers. Get channel IDs from the Channels service. |
channelname |
string body |
Channel name shown in reports. |
autoblacklist |
boolean body |
If true, numbers that fail are added to the blacklist automatically. |
blacklistlink |
boolean body |
If true, an unsubscribe link is appended to the message. Your plan must include the unsubscribe link feature. |
Example request
curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/send-message" \
-H "wapikey: API_ANAHTARINIZ" \
-H "Content-Type: application/json" \
-d '{"type":1,"numbers":"905321234567,905441234567","message":"Merhaba, siparişiniz kargoya verildi.","interval":5}'
import requests
response = requests.post(
"https://www.wapifly.com/api/905XXXXXXXXX/send-message",
headers={"wapikey": "API_ANAHTARINIZ"},
json={
"type": 1,
"numbers": "905321234567,905441234567",
"message": "Merhaba, siparişiniz kargoya verildi.",
"interval": 5
},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/send-message");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"type" => 1,
"numbers" => "905321234567,905441234567",
"message" => "Merhaba, siparişiniz kargoya verildi.",
"interval" => 5
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/send-message", {
method: "POST",
headers: {
"wapikey": "API_ANAHTARINIZ",
"Content-Type": "application/json"
},
body: JSON.stringify({
"type": 1,
"numbers": "905321234567,905441234567",
"message": "Merhaba, siparişiniz kargoya verildi.",
"interval": 5
})
});
console.log(await response.json());
Responses
200Job queued
{
"status": "ok",
"id": "6710A2F4C3B1E2D4F5A6B7C8",
"message": "Mesajınız gönderiliyor. Gönderim durumunu görmek için /message-status servisini çağırın."
}400Invalid parameter
{
"status": "fail",
"errCode": 302,
"message": "En az 1 numara girmelisiniz."
}404WhatsApp session not ready
{
"status": "fail",
"errCode": 404,
"type": "danger",
"title": "Hata Oluştu!",
"message": "Hizmetinizde geçici bir problem yaşanıyor. Kontrol panelinizden onarım yapmalısınız."
}"status": "ok" response means the messages were queued, not delivered. Numbers that are not on WhatsApp are queued too and marked as failed during sending. Use Check Contact to verify numbers before sending.Message Status
POST /{number}/message-status — Can also be called with POST, sending the ID as id in the body.
Returns the overall status of a job and the result for each number, using the ID returned by Send Message.
Parameters
| Name | Type | Description |
|---|---|---|
idrequired |
string path |
The id value from the Send Message response. |
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/message-status/6710A2F4C3B1E2D4F5A6B7C8" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/message-status/6710A2F4C3B1E2D4F5A6B7C8",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/message-status/6710A2F4C3B1E2D4F5A6B7C8");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/message-status/6710A2F4C3B1E2D4F5A6B7C8", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"message": {
"status": "Tamamlandı",
"date": "14.10.2026 15:42:10",
"count": 3,
"success": 1,
"failed": 1,
"waiting": 1,
"list": [
{
"number": "905321234567",
"status": "Gönderildi",
"info": "Gönderildi",
"tarih": "14.10.2026 15:42:11"
},
{
"number": "905441234567",
"status": "Gönderilemedi",
"info": "WhatsApp Kullanmıyor.",
"tarih": "14.10.2026 15:42:16"
},
{
"number": "905551234567",
"status": "Gönderilecek",
"info": "Gönderilecek",
"tarih": "14.10.2026 15:42:21"
}
]
}
}400ID not found
{
"status": "fail",
"errCode": 312,
"message": "Geçersiz ID."
}Number statuses
Gönderildi | Sent: the message was accepted by WhatsApp servers. It does not indicate delivery to the recipient's phone or that it was read. |
Gönderilemedi | Failed. The reason is in info: e.g. not on WhatsApp, invalid number, blacklisted, cancelled. |
Gönderilecek | Waiting: not sent yet. |
Accept-Language header.Check Contact
POST /{number}/check-contact — Can also be called with POST, sending the number as phone in the body.
Checks whether a number is registered on WhatsApp. Use it to filter out invalid numbers before a bulk send.
Parameters
| Name | Type | Description |
|---|---|---|
phonerequired |
string path |
Number to check, with country code (e.g. 905321234567). |
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/check-contact/905321234567" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/check-contact/905321234567",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/check-contact/905321234567");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/check-contact/905321234567", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Number is on WhatsApp
{
"status": "ok",
"number": "905321234567",
"isRegistered": true
}200Number is not on WhatsApp
{
"status": "ok",
"number": "905321234567",
"isRegistered": false
}400Invalid number
{
"status": "fail",
"errCode": 205,
"message": "Geçersiz telefon numarası."
}503WhatsApp session not responding
{
"status": "fail",
"errCode": 112,
"message": "Hizmetinizde geçici bir problem yaşanıyor. Kontrol panelinizden onarım yapmalısınız."
}Contacts
Lists the contacts in your WhatsApp number's address book. Your plan must include the contacts feature.
Parameters
This service takes no parameters.
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/contacts" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/contacts",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/contacts");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/contacts", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"contacts": [
{
"id": "[email protected]",
"name": "Ahmet Yılmaz",
"number": "905321234567",
"isMyContact": true
}
]
}403Not included in plan
{
"status": "fail",
"errCode": 203,
"message": "Paketiniz WhatsApp rehberini desteklemiyor."
}Get Blacklist
Lists the numbers in your blacklist and how they were added. Messages are not sent to blacklisted numbers through Send Message; they appear as blacklisted in the job report.
Parameters
This service takes no parameters.
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/blacklist" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/blacklist",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/blacklist");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/blacklist", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"blacklist": [
{
"number": "905321234567",
"source": "API"
},
{
"number": "905441234567",
"source": "İptal Linki"
}
]
}source values
API | Added through the API. |
Web Panel | Added from the Control Panel. |
Otomatik | Added automatically because sending failed while autoblacklist was on. |
İptal Linki | The recipient clicked the unsubscribe link in a message. |
Add to Blacklist
Adds numbers to the blacklist. Numbers already in the list are not added again.
Parameters
| Name | Type | Description |
|---|---|---|
numbersrequired |
string body |
Numbers to add. Separate multiple numbers with commas or line breaks. |
Example request
curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/blacklist" \
-H "wapikey: API_ANAHTARINIZ" \
-H "Content-Type: application/json" \
-d '{"numbers":"905321234567,905441234567"}'
import requests
response = requests.post(
"https://www.wapifly.com/api/905XXXXXXXXX/blacklist",
headers={"wapikey": "API_ANAHTARINIZ"},
json={
"numbers": "905321234567,905441234567"
},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/blacklist");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"numbers" => "905321234567,905441234567"
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/blacklist", {
method: "POST",
headers: {
"wapikey": "API_ANAHTARINIZ",
"Content-Type": "application/json"
},
body: JSON.stringify({
"numbers": "905321234567,905441234567"
})
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"message": "Numaralar kara listeye eklendi."
}400No valid number
{
"status": "fail",
"errCode": 202,
"message": "En az 1 numara girmelisiniz."
}Remove from Blacklist
Removes numbers from the blacklist. Numbers not in the list are ignored.
Parameters
| Name | Type | Description |
|---|---|---|
numbersrequired |
string body |
Numbers to remove. Separate multiple numbers with commas or line breaks. |
Example request
curl -X DELETE "https://www.wapifly.com/api/905XXXXXXXXX/blacklist" \
-H "wapikey: API_ANAHTARINIZ" \
-H "Content-Type: application/json" \
-d '{"numbers":"905321234567"}'
import requests
response = requests.delete(
"https://www.wapifly.com/api/905XXXXXXXXX/blacklist",
headers={"wapikey": "API_ANAHTARINIZ"},
json={
"numbers": "905321234567"
},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/blacklist");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"numbers" => "905321234567"
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/blacklist", {
method: "DELETE",
headers: {
"wapikey": "API_ANAHTARINIZ",
"Content-Type": "application/json"
},
body: JSON.stringify({
"numbers": "905321234567"
})
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"message": "Numaralar kara listeden silindi."
}400No valid number
{
"status": "fail",
"errCode": 202,
"message": "En az 1 numara girmelisiniz."
}Channels
Lists the channels managed by your WhatsApp number. Use the returned id as the channel parameter of Send Message. Your plan must include the channel feature.
Parameters
This service takes no parameters.
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/get-channels" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/get-channels",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/get-channels");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/get-channels", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"channels": [
{
"id": "120363012345678901@newsletter",
"name": "Kampanyalar"
}
]
}403Not included in plan
{
"status": "fail",
"errCode": 204,
"message": "Paketiniz WhatsApp kanal mesajını desteklemiyor."
}Groups
Lists the groups your WhatsApp number is a member of. Your plan must include the channel feature.
Parameters
This service takes no parameters.
Example request
curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/get-groups" \ -H "wapikey: API_ANAHTARINIZ"
import requests
response = requests.get(
"https://www.wapifly.com/api/905XXXXXXXXX/get-groups",
headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/get-groups");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"wapikey: API_ANAHTARINIZ",
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/get-groups", {
method: "GET",
headers: {
"wapikey": "API_ANAHTARINIZ",
}
});
console.log(await response.json());
Responses
200Success
{
"status": "ok",
"groups": [
{
"id": "[email protected]",
"name": "Bayiler",
"isGroup": true,
"timestamp": 1728909730
}
]
}403Not included in plan
{
"status": "fail",
"errCode": 204,
"message": "Paketiniz WhatsApp kanal mesajını desteklemiyor."
}Error Codes
errCode values returned with errors. Check errCode rather than the message text, which changes with the language.
| errCode | HTTP | Description |
|---|---|---|
100 | 401 | wapikey header is missing or malformed. |
101 | 400 | WhatsApp number is missing from the URL. |
102 | 401 | WhatsApp number or API key is incorrect. |
103 | 401 | Service is inactive. |
104 | 401 | Service setup is not complete. |
105 | 401 | Service is busy; it will be ready in 1-2 minutes. |
106 | 401 | Service has expired. |
107 | 401 | API access is disabled. Enable it in the Control Panel. |
108 | 401 | Request came from an IP that is not allowed. Add the IP value from the response to the allowed IPs in the Control Panel. |
109 | 401 | Repair failed. Scan the QR code again. |
110 | 500 | Session not found. Scan the QR code again. |
111 | 500 | The WhatsApp service returned an error. See message for details. |
112 | 503 | WhatsApp session is not responding. Run Repair Service. |
201 | 401 | Service not found. |
202 | 400 | No valid number given. |
203 | 403 | Your plan does not include contacts. |
204 | 403 | Your plan does not include channels. |
205 | 400 | Invalid phone number. |
301 | 400 | Invalid message type (type). |
302 | 400 | No valid number given. |
303 | 400 | interval cannot be less than 1 second. |
304 | 400 | Invalid URL. It must start with https://. |
305 | 400 | Message cannot be empty. |
306 | 500 | An unexpected error occurred. |
307 | 404 | Service not found. |
308 | 403 | Your plan does not support text messages. |
309 | 403 | Your plan does not support image, video or channel messages. |
310 | 403 | Your plan does not support document messages. |
311 | 403 | Your plan does not support audio messages. |
312 | 400 | Invalid job ID. |
313 | 400 | Invalid channel ID. It must end with @newsletter. |
404 | 404 | The WhatsApp session was not ready when sending. Run Repair Service. |