API Documentation

Connect your WhatsApp number to your own software.

docs.md Paste the full document into ChatGPT, Claude, Cursor or similar tools to have them write the integration.

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.

HeaderDescription
wapikey requiredYour 64-character API key.
Content-Typeapplication/json for requests with a body.
Accept-LanguageLanguage 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:

  1. Optional: use Check Contact to verify that numbers are registered on WhatsApp.
  2. A Send Message request queues the job and immediately returns an id. At this point "status": "ok" only means the request was accepted.
  3. Messages are sent one by one in the background at the interval you set. Numbers that are unregistered, invalid or blacklisted are marked as failed at this stage.
  4. Call Message Status with the id to get the result and failure reason for each number.

Service Status

GET /{number}/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

readyConnected, messages can be sent.
initializingSession is starting.
connectingConnecting to WhatsApp.
authenticatedLogged in, getting ready.
qr_readyWaiting for QR scan. Scan the QR code from the Control Panel.
disconnectedDisconnected. Try reconnecting with Repair Service.
failedSession failed to start.

Repair Service

POST /{number}/repair

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."
}

Send Message

POST /{number}/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

NameTypeDescription
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.
numbers
required
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."
}

Message Status

GET /{number}/message-status/{id}

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

NameTypeDescription
id
required
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önderildiSent: the message was accepted by WhatsApp servers. It does not indicate delivery to the recipient's phone or that it was read.
GönderilemediFailed. The reason is in info: e.g. not on WhatsApp, invalid number, blacklisted, cancelled.
GönderilecekWaiting: not sent yet.

Check Contact

GET /{number}/check-contact/{phone}

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

NameTypeDescription
phone
required
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

GET /{number}/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

GET /{number}/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

APIAdded through the API.
Web PanelAdded from the Control Panel.
OtomatikAdded automatically because sending failed while autoblacklist was on.
İptal LinkiThe recipient clicked the unsubscribe link in a message.

Add to Blacklist

POST /{number}/blacklist

Adds numbers to the blacklist. Numbers already in the list are not added again.

Parameters

NameTypeDescription
numbers
required
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

DELETE /{number}/blacklist

Removes numbers from the blacklist. Numbers not in the list are ignored.

Parameters

NameTypeDescription
numbers
required
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

GET /{number}/get-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

GET /{number}/get-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.

errCodeHTTPDescription
100401wapikey header is missing or malformed.
101400WhatsApp number is missing from the URL.
102401WhatsApp number or API key is incorrect.
103401Service is inactive.
104401Service setup is not complete.
105401Service is busy; it will be ready in 1-2 minutes.
106401Service has expired.
107401API access is disabled. Enable it in the Control Panel.
108401Request came from an IP that is not allowed. Add the IP value from the response to the allowed IPs in the Control Panel.
109401Repair failed. Scan the QR code again.
110500Session not found. Scan the QR code again.
111500The WhatsApp service returned an error. See message for details.
112503WhatsApp session is not responding. Run Repair Service.
201401Service not found.
202400No valid number given.
203403Your plan does not include contacts.
204403Your plan does not include channels.
205400Invalid phone number.
301400Invalid message type (type).
302400No valid number given.
303400interval cannot be less than 1 second.
304400Invalid URL. It must start with https://.
305400Message cannot be empty.
306500An unexpected error occurred.
307404Service not found.
308403Your plan does not support text messages.
309403Your plan does not support image, video or channel messages.
310403Your plan does not support document messages.
311403Your plan does not support audio messages.
312400Invalid job ID.
313400Invalid channel ID. It must end with @newsletter.
404404The WhatsApp session was not ready when sending. Run Repair Service.