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.
Idempotency-KeyOptional, up to 100 characters. Idempotency: a request resent with the same key is not processed again.

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. For tools without a fixed IP (Zapier, Make, plugins) use an integration key.

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. Official API rule: send the first message to a person, and any message more than 24 hours after their last message, with a Meta-approved template.
  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.

Integrations & Webhooks

For no-code tools such as Zapier, Make and n8n, e-commerce plugins and your own systems. Settings: Control Panel > API Settings > Integrations. Step-by-step setup for Zapier, Make and n8n: Integrations.

Integration key

Used in the wapikey header instead of your API key. No IP whitelist is required; instead at most 120 requests per minute are allowed. Over the limit you get HTTP 429, errCode: 332 and a Retry-After header; the remaining quota is in X-RateLimit-Remaining. The key is shown only when created; if you lose it, regenerate it.

Idempotency (Idempotency-Key)

For Send Message, Send Code and Add People, put a request-specific value (e.g. an order number) in the Idempotency-Key header. If the same request is retried with the same key after a timeout, it is not processed again; the first response is returned as is with Idempotent-Replayed: true (24 hours). Using the same key with a different body, or while the first request is still in progress, returns errCode: 333.

Event webhook

When the events you choose happen, JSON is sent to your address with POST. Non-2xx responses and timeouts (10 s) count as failures and are retried after 1 minute, 10 minutes and 1 hour. Recent deliveries are listed on the API Settings page.

{
  "event": "message.received",
  "service": "905321234567",
  "created_at": "2026-10-20T09:00:00.000Z",
  "data": {
    "id": "3EB0C431B8F1A2",
    "from": "905321234567",
    "to": null,
    "type": "chat",
    "body": "Merhaba, siparişim ne durumda?",
    "timestamp": 1792440000,
    "is_group": false
  }
}
EventDescriptiondata
message.receivedA message was received on your number.{"id":"3EB0C431B8F1A2","from":"905321234567","to":null,"type":"chat","body":"Merhaba, siparişim ne durumda?","timestamp":1792440000,"is_group":false}
message.sentA message was sent from your number (from the phone, panel or API).{"id":"3EB0D2F1C9A7B3","from":null,"to":"905321234567","type":"chat","body":"Siparişiniz kargoya verildi.","timestamp":1792440060,"is_group":false}
message.deliveredA message you sent reached the recipient's phone. job_id is set for bulk / API jobs.{"id":"3EB09B8667A106C38F6A10","job_id":"6710A2F4C3B1E2D4F5A6B7C8","to":"905321234567","delivered_at":"2026-10-14T12:42:14.000Z","delivered_after_sec":3}
message.readA message you sent was read. Does not arrive for people who turned off read receipts, nor for messages from WhatsApp Business numbers until the recipient replies or saves your number. If read receipts are turned off on the sending number, WhatsApp never reports reads.{"id":"3EB09B8667A106C38F6A10","job_id":"6710A2F4C3B1E2D4F5A6B7C8","to":"905321234567","delivered_at":"2026-10-14T12:42:14.000Z","delivered_after_sec":3,"read_at":"2026-10-14T12:48:02.000Z","read_after_sec":351}
job.completedA job finished or was cancelled (state: completed / cancelled).{"job_id":"6710A2F4C3B1E2D4F5A6B7C8","state":"completed","channel":"api","count":3,"success":2,"failed":1,"waiting":0,"created_at":"2026-10-20T09:00:00.000Z"}
job.pausedThe system paused a job (pause_reason: connection or invalid_numbers).{"job_id":"6710A2F4C3B1E2D4F5A6B7C8","state":"paused","pause_reason":"connection","channel":"panel","count":500,"success":120,"failed":3,"waiting":377,"created_at":"2026-10-20T09:00:00.000Z"}
connection.lostThe WhatsApp connection has been down for more than 5 minutes.{"disconnected_at":"2026-10-20T09:00:00.000Z"}
connection.restoredA connection reported as lost is back.{"connected_at":"2026-10-20T09:30:00.000Z"}

Signature verification

Every request has X-WApifly-Timestamp (Unix seconds) and X-WApifly-Signature headers. The signature is HMAC-SHA256(timestamp + "." + raw body) with the signing secret shown in the panel, hex-encoded and prefixed with sha256=. Verify it to make sure the request really comes from WApifly, and reject requests older than 5 minutes. Messages forwarded to your Message Forwarding address are signed with the same headers once a signing secret has been created.

const crypto = require('crypto');

// express.raw({type: 'application/json'}) ile gövdeyi ham haliyle alın
function imzaDogru(hamGovde, basliklar, sir) {
  const zaman = basliklar['x-wapifly-timestamp'];
  const beklenen = 'sha256=' + crypto.createHmac('sha256', sir).update(zaman + '.' + hamGovde).digest('hex');
  const gelen = basliklar['x-wapifly-signature'] || '';
  const tazeMi = Math.abs(Date.now() / 1000 - Number(zaman)) < 300;
  return tazeMi && gelen.length === beklenen.length && crypto.timingSafeEqual(Buffer.from(gelen), Buffer.from(beklenen));
}
<?php
$govde = file_get_contents('php://input');
$zaman = $_SERVER['HTTP_X_WAPIFLY_TIMESTAMP'] ?? '';
$gelen = $_SERVER['HTTP_X_WAPIFLY_SIGNATURE'] ?? '';
$beklenen = 'sha256=' . hash_hmac('sha256', $zaman . '.' . $govde, $sir);
if (abs(time() - (int)$zaman) > 300 || !hash_equals($beklenen, $gelen)) {
    http_response_code(401);
    exit;
}
$olay = json_decode($govde, true);

Service Status

GET /{number}/status

Shows whether the official WhatsApp API connection of your number is ready.

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

state values

readyConnected, messages can be sent.

Send Message

POST /{number}/send-message

Sends a text, image, document, audio or video message to one or more numbers. 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.
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.
interval_max integer
body
If set, a random delay between interval and interval_max is applied after each message. Cannot be less than interval.
schedule string
body
When the sending should start. ISO 8601 with a time zone (e.g. 2026-10-20T09:30:00+03:00) or a Unix timestamp (seconds). If omitted, sending starts immediately. Cannot be after the service expiry date.
tags string | array
body
Sends to people in your people list who have any of these tags (comma-separated or an array). {isim} / {name} in the message is replaced with each person's name, or left empty if there is none. If numbers is also given, both are combined. Your plan must include people lists.
template_id string
body
Sends using a template created in the Control Panel; message type, text and media come from the template (type, message and url are ignored). Get IDs from the Templates service.
variables object
body
Values for the {field} placeholders in the template text, e.g. {"name": "Ayşe", "order": "1042"}. When sending as a form, pass it as a JSON string. Placeholders without a value are processed like spintax rather than left as is, so send all fields of the template.
autoblacklist boolean
body
If true, numbers that fail are added to the blacklist automatically.

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

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": "Gönderiliyor",
    "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",
        "state": "sent",
        "delivery": "read",
        "delivered_at": "2026-10-14T12:42:14.000Z",
        "read_at": "2026-10-14T12:48:02.000Z",
        "delivered_after_sec": 3,
        "read_after_sec": 351,
        "updated_at": "2026-10-14T12:42:11.000Z"
      },
      {
        "number": "905441234567",
        "status": "Gönderilemedi",
        "info": "WhatsApp Kullanmıyor.",
        "tarih": "14.10.2026 15:42:16",
        "state": "failed",
        "delivery": null,
        "updated_at": "2026-10-14T12:42:16.000Z"
      },
      {
        "number": "905551234567",
        "status": "Gönderilecek",
        "info": "Gönderilecek",
        "tarih": "14.10.2026 15:42:21",
        "state": "pending",
        "delivery": null,
        "updated_at": "2026-10-14T12:42:10.000Z"
      }
    ],
    "state": "sending",
    "created_at": "2026-10-14T12:42:10.000Z",
    "delivery": {
      "tracked": 1,
      "delivered": 1,
      "read": 1,
      "median_delivery_sec": 3,
      "median_read_sec": 351
    }
  }
}

400ID not found

{
  "status": "fail",
  "errCode": 312,
  "message": "Geçersiz ID."
}

Number statuses

GönderildiSent: the message was accepted by WhatsApp servers. Whether it reached the phone and was read is in the delivery field.
deliverysent, delivered (reached the recipient's phone), read, played (voice message played). delivered_at / read_at are when it first happened, delivered_after_sec / read_after_sec how many seconds after sending. null for failed and pending numbers. The summary is in message.delivery. read does not arrive for people who turned off read receipts, nor for messages from WhatsApp Business numbers until the recipient replies or saves your number. If read receipts are turned off on the sending number, WhatsApp never reports reads.
GönderilemediFailed. The reason is in info: e.g. not on WhatsApp, invalid number, blacklisted, cancelled.
GönderilecekWaiting: not sent yet.

Pause Sending

POST /{number}/pause-sending

Pauses a running or scheduled job. Remaining numbers are not sent until the job is resumed.

Parameters

NameTypeDescription
id
required
string
body
The id value from the Send Message response.

Example request

curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/pause-sending" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"id":"6710A2F4C3B1E2D4F5A6B7C8"}'
import requests

response = requests.post(
    "https://www.wapifly.com/api/905XXXXXXXXX/pause-sending",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "id": "6710A2F4C3B1E2D4F5A6B7C8"
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/pause-sending");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "wapikey: API_ANAHTARINIZ",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "id" => "6710A2F4C3B1E2D4F5A6B7C8"
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/pause-sending", {
  method: "POST",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "id": "6710A2F4C3B1E2D4F5A6B7C8"
  })
});
console.log(await response.json());

Responses

200Paused

{
  "status": "ok",
  "id": "6710A2F4C3B1E2D4F5A6B7C8",
  "message": "Gönderim duraklatıldı."
}

400Job finished or already paused

{
  "status": "fail",
  "errCode": 317,
  "message": "Gönderim bu işlem için uygun durumda değil."
}

Resume Sending

POST /{number}/resume-sending

Resumes a paused job from where it left off. If the job is scheduled, it starts at its start time.

Parameters

NameTypeDescription
id
required
string
body
The id value from the Send Message response.

Example request

curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/resume-sending" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"id":"6710A2F4C3B1E2D4F5A6B7C8"}'
import requests

response = requests.post(
    "https://www.wapifly.com/api/905XXXXXXXXX/resume-sending",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "id": "6710A2F4C3B1E2D4F5A6B7C8"
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/resume-sending");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "wapikey: API_ANAHTARINIZ",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "id" => "6710A2F4C3B1E2D4F5A6B7C8"
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/resume-sending", {
  method: "POST",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "id": "6710A2F4C3B1E2D4F5A6B7C8"
  })
});
console.log(await response.json());

Responses

200Resumed

{
  "status": "ok",
  "id": "6710A2F4C3B1E2D4F5A6B7C8",
  "message": "Gönderim devam ediyor."
}

400Job is not paused

{
  "status": "fail",
  "errCode": 317,
  "message": "Gönderim bu işlem için uygun durumda değil."
}

Cancel Sending

POST /{number}/cancel-sending

Cancels a running, scheduled or paused job. Numbers not sent yet are marked as cancelled. This cannot be undone.

Parameters

NameTypeDescription
id
required
string
body
The id value from the Send Message response.

Example request

curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/cancel-sending" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"id":"6710A2F4C3B1E2D4F5A6B7C8"}'
import requests

response = requests.post(
    "https://www.wapifly.com/api/905XXXXXXXXX/cancel-sending",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "id": "6710A2F4C3B1E2D4F5A6B7C8"
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/cancel-sending");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "wapikey: API_ANAHTARINIZ",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "id" => "6710A2F4C3B1E2D4F5A6B7C8"
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/cancel-sending", {
  method: "POST",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "id": "6710A2F4C3B1E2D4F5A6B7C8"
  })
});
console.log(await response.json());

Responses

200Cancelled

{
  "status": "ok",
  "id": "6710A2F4C3B1E2D4F5A6B7C8",
  "message": "Gönderim iptal edildi."
}

400Job already finished

{
  "status": "fail",
  "errCode": 317,
  "message": "Gönderim bu işlem için uygun durumda değil."
}

Job List

GET /{number}/jobs

Lists your past jobs, newest first, with pagination. Use it to find a job ID you lost. For per-number results use Message Status.

Parameters

NameTypeDescription
page integer
query
Page number. Default 1.
limit integer
query
Records per page. Default 20, maximum 100.
from string
query
Created at or after this time. ISO 8601 with a time zone or a Unix timestamp.
to string
query
Created at or before this time.

Example request

curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/jobs?page=1&limit=20&channel=api" \
  -H "wapikey: API_ANAHTARINIZ"
import requests

response = requests.get(
    "https://www.wapifly.com/api/905XXXXXXXXX/jobs?page=1&limit=20&channel=api",
    headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/jobs?page=1&limit=20&channel=api");
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/jobs?page=1&limit=20&channel=api", {
  method: "GET",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
  }
});
console.log(await response.json());

Responses

200Success

{
  "status": "ok",
  "page": 1,
  "limit": 20,
  "total": 57,
  "jobs": [
    {
      "id": "6710A2F4C3B1E2D4F5A6B7C8",
      "state": "completed",
      "status": "Tamamlandı",
      "channel": "api",
      "type": 1,
      "count": 3,
      "success": 2,
      "failed": 1,
      "waiting": 0,
      "created_at": "2026-10-14T12:42:10.000Z"
    }
  ]
}

400Invalid date

{
  "status": "fail",
  "errCode": 321,
  "message": "Geçersiz tarih filtresi. Saat dilimi içeren ISO 8601 ya da Unix zaman damgası kullanın."
}

Templates

GET /{number}/templates

Lists the message templates you created in the Control Panel. Use the returned id as template_id in Send Message. variables are the {field} placeholders in the template text.

Parameters

This service takes no parameters.

Example request

curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/templates" \
  -H "wapikey: API_ANAHTARINIZ"
import requests

response = requests.get(
    "https://www.wapifly.com/api/905XXXXXXXXX/templates",
    headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/templates");
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/templates", {
  method: "GET",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
  }
});
console.log(await response.json());

Responses

200Success

{
  "status": "ok",
  "templates": [
    {
      "id": "6711B3C4D5E6F7A8B9C0D1E2",
      "name": "Sipariş Onayı",
      "type": 1,
      "message": "Merhaba {isim}, {siparis} numaralı siparişiniz alındı.",
      "url": "",
      "variables": [
        "isim",
        "siparis"
      ]
    }
  ]
}

Send Code

POST /{number}/otp/send

Sends a verification code to a number. WApifly generates the code and sends it immediately without queueing; the code is not returned in the response. Check the code your user enters with Verify Code. Your plan must include OTP.

Parameters

NameTypeDescription
phone
required
string
body
Number to send the code to, with country code.
length integer
body
Code length, 4-8. Default 6.
ttl integer
body
Validity in seconds, 60-900. Default 300.
message string
body
Your own message text. {code} is required, {minutes} optional; at most 500 characters. If omitted, a ready-made text in the Accept-Language language is used.

Example request

curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/otp/send" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"phone":"905321234567","message":"Siparişinizi onaylamak için kodunuz: {code}. {minutes} dakika geçerlidir."}'
import requests

response = requests.post(
    "https://www.wapifly.com/api/905XXXXXXXXX/otp/send",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "phone": "905321234567",
        "message": "Siparişinizi onaylamak için kodunuz: {code}. {minutes} dakika geçerlidir."
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/otp/send");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "wapikey: API_ANAHTARINIZ",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "phone" => "905321234567",
        "message" => "Siparişinizi onaylamak için kodunuz: {code}. {minutes} dakika geçerlidir."
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/otp/send", {
  method: "POST",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "phone": "905321234567",
    "message": "Siparişinizi onaylamak için kodunuz: {code}. {minutes} dakika geçerlidir."
  })
});
console.log(await response.json());

Responses

200Sent

{
  "status": "ok",
  "id": "6712C4D5E6F7A8B9C0D1E2F3",
  "phone": "905321234567",
  "expires_at": "2026-10-20T10:05:00.000Z",
  "message": "Doğrulama kodu gönderildi."
}

429Too frequent

{
  "status": "fail",
  "errCode": 326,
  "message": "Bu numaraya yeni kod için 18 saniye bekleyin.",
  "retry_after": 18
}

502Could not send

{
  "status": "fail",
  "errCode": 325,
  "message": "Doğrulama kodu gönderilemedi: WhatsApp Kullanmıyor."
}

Verify Code

POST /{number}/otp/verify

Compares the code your user entered with the latest code sent to that number. Codes are single-use; once verified they cannot be used again. At most 5 wrong attempts are allowed, after which a new code must be requested.

Parameters

NameTypeDescription
phone
required
string
body
Number the code was sent to.
code
required
string
body
The code your user entered.

Example request

curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/otp/verify" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"phone":"905321234567","code":"482915"}'
import requests

response = requests.post(
    "https://www.wapifly.com/api/905XXXXXXXXX/otp/verify",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "phone": "905321234567",
        "code": "482915"
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/otp/verify");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "wapikey: API_ANAHTARINIZ",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "phone" => "905321234567",
        "code" => "482915"
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/otp/verify", {
  method: "POST",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "phone": "905321234567",
    "code": "482915"
  })
});
console.log(await response.json());

Responses

200Correct code

{
  "status": "ok",
  "verified": true,
  "phone": "905321234567",
  "message": "Kod doğrulandı."
}

400Wrong code

{
  "status": "fail",
  "errCode": 330,
  "message": "Kod hatalı.",
  "verified": false,
  "remaining_attempts": 4
}

400No valid code

{
  "status": "fail",
  "errCode": 328,
  "message": "Bu numara için geçerli bir kod yok. Kodun süresi dolmuş, kullanılmış ya da hiç gönderilmemiş olabilir.",
  "verified": false
}

List People

GET /{number}/people

Returns your People list from the Control Panel, paginated. This list is separate from your WhatsApp contacts; it is grouped with tags and used with tags in Send Message. Your plan must include people lists.

Parameters

NameTypeDescription
tag string
query
Only people with this tag.
q string
query
Search in name or number.
page integer
query
Page number. Default 1.
limit integer
query
Records per page. Default 100, maximum 500.

Example request

curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/people?tag=VIP" \
  -H "wapikey: API_ANAHTARINIZ"
import requests

response = requests.get(
    "https://www.wapifly.com/api/905XXXXXXXXX/people?tag=VIP",
    headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/people?tag=VIP");
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/people?tag=VIP", {
  method: "GET",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
  }
});
console.log(await response.json());

Responses

200Success

{
  "status": "ok",
  "page": 1,
  "limit": 100,
  "total": 1,
  "people": [
    {
      "number": "905321234567",
      "name": "Ayşe Yılmaz",
      "tags": [
        "VIP",
        "İstanbul"
      ],
      "created_at": "2026-10-14T12:42:10.000Z"
    }
  ]
}

403Not included in plan

{
  "status": "fail",
  "errCode": 207,
  "message": "Paketiniz kişi listelerini desteklemiyor."
}

Add / Update People

POST /{number}/people

Adds people to your list in bulk. For numbers already in the list, the name is updated (if given) and tags are added; existing tags are kept. Up to 5000 people per request.

Parameters

NameTypeDescription
people
required
array
body
People: [{"number": "905321234567", "name": "Ayşe", "tags": ["VIP"]}]. name and tags are optional.
tags string | array
body
Tags to add to every person in this request.

Example request

curl -X POST "https://www.wapifly.com/api/905XXXXXXXXX/people" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"people":[{"number":"905321234567","name":"Ayşe Yılmaz","tags":["VIP"]},{"number":"905441234567","name":"Mehmet Demir"}],"tags":"Ekim Kampanyası"}'
import requests

response = requests.post(
    "https://www.wapifly.com/api/905XXXXXXXXX/people",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "people": [{"number":"905321234567","name":"Ayşe Yılmaz","tags":["VIP"]},{"number":"905441234567","name":"Mehmet Demir"}],
        "tags": "Ekim Kampanyası"
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/people");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "wapikey: API_ANAHTARINIZ",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "people" => [{"number":"905321234567","name":"Ayşe Yılmaz","tags":["VIP"]},{"number":"905441234567","name":"Mehmet Demir"}],
        "tags" => "Ekim Kampanyası"
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const response = await fetch("https://www.wapifly.com/api/905XXXXXXXXX/people", {
  method: "POST",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "people": [
      {
        "number": "905321234567",
        "name": "Ayşe Yılmaz",
        "tags": [
          "VIP"
        ]
      },
      {
        "number": "905441234567",
        "name": "Mehmet Demir"
      }
    ],
    "tags": "Ekim Kampanyası"
  })
});
console.log(await response.json());

Responses

200Success

{
  "status": "ok",
  "added": 1,
  "updated": 1,
  "invalid": 0
}

400Invalid list

{
  "status": "fail",
  "errCode": 208,
  "message": "people, numarası (number) olan kişilerden oluşan bir dizi olmalıdır."
}

Delete People

DELETE /{number}/people

Deletes the given numbers from your people list.

Parameters

NameTypeDescription
numbers
required
string | array
body
Numbers to delete (comma-separated or an array).

Example request

curl -X DELETE "https://www.wapifly.com/api/905XXXXXXXXX/people" \
  -H "wapikey: API_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"numbers":"905321234567"}'
import requests

response = requests.delete(
    "https://www.wapifly.com/api/905XXXXXXXXX/people",
    headers={"wapikey": "API_ANAHTARINIZ"},
    json={
        "numbers": "905321234567"
    },
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/people");
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/people", {
  method: "DELETE",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "numbers": "905321234567"
  })
});
console.log(await response.json());

Responses

200Success

{
  "status": "ok",
  "deleted": 1
}

Tags

GET /{number}/tags

Returns the tags in your people list and the number of people with each tag.

Parameters

This service takes no parameters.

Example request

curl -X GET "https://www.wapifly.com/api/905XXXXXXXXX/tags" \
  -H "wapikey: API_ANAHTARINIZ"
import requests

response = requests.get(
    "https://www.wapifly.com/api/905XXXXXXXXX/tags",
    headers={"wapikey": "API_ANAHTARINIZ"},
)
print(response.json())
<?php
$ch = curl_init("https://www.wapifly.com/api/905XXXXXXXXX/tags");
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/tags", {
  method: "GET",
  headers: {
    "wapikey": "API_ANAHTARINIZ",
  }
});
console.log(await response.json());

Responses

200Success

{
  "status": "ok",
  "tags": [
    {
      "name": "VIP",
      "count": 42
    },
    {
      "name": "İstanbul",
      "count": 118
    }
  ]
}

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

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.
111500The WhatsApp service returned an error. See message for details.
201401Service not found.
202400No valid number given.
205400Invalid phone number.
206400Bulk check accepts at most 50 numbers per request.
207403Your plan does not include people lists.
208400people is invalid or has more than 5000 people.
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 or video messages.
310403Your plan does not support document messages.
311403Your plan does not support audio messages.
312400Invalid job ID.
314400Invalid or past schedule. Use ISO 8601 with a time zone or a Unix timestamp.
315400schedule cannot be after the service expiry date.
316400interval_max cannot be less than interval.
317400The job is not in a suitable state for this action (e.g. pausing a finished job).
319400Template not found.
320400variables must be a JSON object.
321400Invalid from / to date.
322400Invalid channel filter.
323400No people have the given tags.
324400Invalid OTP parameter (phone, code, length, ttl or message).
325502The verification code could not be sent. See message for the reason.
326429A new code was requested for the same number within 30 seconds. Retry after retry_after seconds.
3274295 codes were already sent to this number in the last hour.
328400No valid code for the number (expired, used or never sent).
329429Too many wrong attempts; request a new code.
330400Wrong code. remaining_attempts is the number of attempts left.
331403Your plan does not include OTP.
332429Per-minute request limit (120) for the integration key exceeded. Retry after retry_after seconds.
333400/409/422Idempotency-Key problem: longer than 100 characters (400), the first request with this key is still in progress (409) or the key was used with a different request (422).
334403The free trial message limit has been reached. Purchase a plan to continue.
335403The message was not sent because it violates our content rules (promotion of betting, gambling, tobacco products or illegal goods). Contact us if you think this is a mistake.