Build on CLEANPANELS —
with or without code.
The standard SMM API on every panel, plus a REST API for WhatsApp numbers and email. Every example comes ready to copy in cURL, PHP, Python and Node.js — and one click gives your AI assistant everything it needs to write the code for you.
Three steps to your first request.
You don't have to be a developer. Get a key, pick the example that matches what you want, and paste it — or let an AI assistant write the code for you (next section).
Get your key
Panel API: on your panel go to Account → API. Platform API: create a sk_live_… key in your console under API keys.
Keep it secret
Store the key in an environment variable or your hosting's settings — never inside code you share or paste into a chat.
Copy an example
Every endpoint below has a working sample. Pick your language on the left once and every example switches.
Orders, services, refills
POST https://yourbrand.cleanpanels.co.ke/api/v2- Form fields:
key+action - Works with every reseller script that supports API v2
- Use your panel's own domain in place of
yourbrand.cleanpanels.co.ke
WhatsApp, email, wallet
https://cleanpanels.co.ke/api/v1- Header:
Authorization: Bearer sk_live_… - JSON in, JSON out
- Works from any app — even panels hosted elsewhere
Not a developer? Let AI write it.
ChatGPT, Claude, Gemini and Copilot can all write working integrations for you — they just need the full API reference. One button copies a ready-made prompt that includes everything.
The ready-made AI prompt
- Click Copy AI prompt below.
- Open your AI assistant and paste it.
- Replace the two lines in [square brackets] with what you want to build and where it will run.
- Follow its steps. If something fails, paste the error message back to the AI — it will fix the code.
AI tools that can read web pages can also be given this link directly: https://cleanpanels.co.ke/developers/llms. The OpenAPI file imports into Postman, Insomnia or a custom GPT action.
YOUR_API_KEY or an environment variable, then add the real key yourself on your server. If a key was ever shared, regenerate it straight away (panel: Account → API · console: API keys).Ideas to start with
Each button copies the full prompt with that idea already filled in.
Keep keys safe, handle errors kindly.
All examples read the key from an environment variable. Here is how to set one — pick whatever matches where your code runs.
# Mac / Linux terminal — lasts until you close the window
export PANEL_API_KEY="paste-your-panel-key"
export CLEANPANELS_API_KEY="sk_live_paste-your-key"
# Windows PowerShell
$env:PANEL_API_KEY = "paste-your-panel-key"<?php
// Shared hosting / cPanel without environment variables:
// put the key in a file OUTSIDE public_html, e.g. /home/you/secrets.php
return ['PANEL_API_KEY' => 'paste-your-panel-key'];
// then, in your script:
$secrets = require '/home/you/secrets.php';
$apiKey = getenv('PANEL_API_KEY') ?: $secrets['PANEL_API_KEY'];# pip install python-dotenv requests
# .env file next to your script (add .env to .gitignore!):
# PANEL_API_KEY=paste-your-panel-key
from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.environ["PANEL_API_KEY"]// Node.js 20+: put the key in a .env file (add .env to .gitignore!)
// PANEL_API_KEY=paste-your-panel-key
// then run: node --env-file=.env app.js
const apiKey = process.env.PANEL_API_KEY;Panel API errors
HTTP is always 200; check for an error field.
{
"success": false,
"error": "Not enough funds on balance"
}Common: Invalid API key · Incorrect service ID · Quantity less than minimal · Not enough funds on balance · Incorrect order ID.
Platform API errors
Real HTTP status codes with a machine-readable code.
{
"error": {
"code": "insufficient_funds",
"message": "Top up your wallet to continue."
}
}401 | Missing or wrong API key |
402 | Wallet needs topping up |
404 / 409 | Not found / already exists |
422 | Invalid input — message says which field |
429 | More than 120 requests a minute — wait and retry |
Orders, services and refills.
Every request is a POST to https://yourbrand.cleanpanels.co.ke/api/v2 (your panel's domain) with form fields key and action. Your panel uses the same API to connect to its providers — and offers it to your resellers.
List services
POSTaction=servicesEvery service you can order, with price per 1,000, limits and options. Call it once and cache it.
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=services"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'services',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "services",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "services",
}),
});
console.log(await response.json());[
{
"service": 1042,
"name": "Instagram Followers [Real]",
"type": "Default",
"category": "Instagram",
"rate": "1.20",
"min": "10",
"max": "100000",
"refill": true,
"cancel": false
}
]Place an order
POSTaction=addCreates an order and charges your balance. Keep the returned order ID to check its status.
service | Service ID from "services" | 1042 |
link | Profile or post link | https://instagram.com/yourbrand |
quantity | Between the service min and max | 1000 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=add" \
--data-urlencode "service=1042" \
--data-urlencode "link=https://instagram.com/yourbrand" \
--data-urlencode "quantity=1000"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'add',
'service' => '1042',
'link' => 'https://instagram.com/yourbrand',
'quantity' => '1000',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "add",
"service": "1042",
"link": "https://instagram.com/yourbrand",
"quantity": "1000",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "add",
service: "1042",
link: "https://instagram.com/yourbrand",
quantity: "1000",
}),
});
console.log(await response.json());{
"order": 20481
}Order with drip-feed
POSTaction=addSpreads delivery over time so growth looks natural. Total = quantity × runs.
service | Service ID | 1042 |
link | Link | https://instagram.com/yourbrand |
quantity | Quantity per run | 500 |
runs | How many runs | 10 |
interval | Minutes between runs | 60 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=add" \
--data-urlencode "service=1042" \
--data-urlencode "link=https://instagram.com/yourbrand" \
--data-urlencode "quantity=500" \
--data-urlencode "runs=10" \
--data-urlencode "interval=60"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'add',
'service' => '1042',
'link' => 'https://instagram.com/yourbrand',
'quantity' => '500',
'runs' => '10',
'interval' => '60',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "add",
"service": "1042",
"link": "https://instagram.com/yourbrand",
"quantity": "500",
"runs": "10",
"interval": "60",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "add",
service: "1042",
link: "https://instagram.com/yourbrand",
quantity: "500",
runs: "10",
interval: "60",
}),
});
console.log(await response.json());{
"order": 20482
}Order custom comments
POSTaction=addFor services of type "Custom Comments". The quantity is the number of lines.
service | A "Custom Comments" service | 2210 |
link | Post link | https://instagram.com/p/POST_ID |
comments | One comment per line (\n) | Love this!\nSo good 🔥\nWow |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=add" \
--data-urlencode "service=2210" \
--data-urlencode "link=https://instagram.com/p/POST_ID" \
--data-urlencode $'comments=Love this!\nSo good 🔥\nWow'<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'add',
'service' => '2210',
'link' => 'https://instagram.com/p/POST_ID',
'comments' => "Love this!\nSo good 🔥\nWow",
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "add",
"service": "2210",
"link": "https://instagram.com/p/POST_ID",
"comments": "Love this!\nSo good 🔥\nWow",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "add",
service: "2210",
link: "https://instagram.com/p/POST_ID",
comments: "Love this!\nSo good 🔥\nWow",
}),
});
console.log(await response.json());{
"order": 20483
}Order status
POSTaction=statusStatus values: Pending, Processing, In progress, Completed, Partial, Canceled. "remains" is how much is left to deliver.
order | Order ID | 20481 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=status" \
--data-urlencode "order=20481"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'status',
'order' => '20481',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "status",
"order": "20481",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "status",
order: "20481",
}),
});
console.log(await response.json());{
"charge": "1.20",
"start_count": "1290",
"status": "In progress",
"remains": "380",
"currency": "USD"
}Status of many orders
POSTaction=statusOne request for up to 100 orders — use this for dashboards and scheduled checks.
orders | Up to 100 IDs, comma separated | 20481,20482,20483 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=status" \
--data-urlencode "orders=20481,20482,20483"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'status',
'orders' => '20481,20482,20483',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "status",
"orders": "20481,20482,20483",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "status",
orders: "20481,20482,20483",
}),
});
console.log(await response.json());{
"20481": {
"charge": "1.20",
"start_count": "1290",
"status": "Completed",
"remains": "0",
"currency": "USD"
},
"20482": {
"error": "Incorrect order ID"
}
}Request a refill
POSTaction=refillOnly for services with "refill": true, when the count dropped.
order | Order ID (or "orders" for several) | 20481 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=refill" \
--data-urlencode "order=20481"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'refill',
'order' => '20481',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "refill",
"order": "20481",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "refill",
order: "20481",
}),
});
console.log(await response.json());{
"refill": "7731"
}Refill status
POSTaction=refill_statusStatus of a refill request.
refill | Refill ID (or "refills" for several) | 7731 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=refill_status" \
--data-urlencode "refill=7731"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'refill_status',
'refill' => '7731',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "refill_status",
"refill": "7731",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "refill_status",
refill: "7731",
}),
});
console.log(await response.json());{
"status": "Completed"
}Cancel orders
POSTaction=cancelOnly for services with "cancel": true that have not started.
orders | Comma separated order IDs | 20481,20482 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=cancel" \
--data-urlencode "orders=20481,20482"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'cancel',
'orders' => '20481,20482',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "cancel",
"orders": "20481,20482",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "cancel",
orders: "20481,20482",
}),
});
console.log(await response.json());[
{
"order": 20481,
"cancel": 1
},
{
"order": 20482,
"cancel": {
"error": "Incorrect order ID"
}
}
]Ask to speed up
POSTaction=speedupSends a speed-up request for a running order to the panel's support team.
order | Order ID (or "orders" for several) | 20481 |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=speedup" \
--data-urlencode "order=20481"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'speedup',
'order' => '20481',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "speedup",
"order": "20481",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "speedup",
order: "20481",
}),
});
console.log(await response.json());{
"speedup": 1
}Plain-language request
POSTaction=requestUnderstands a support message like a human would — perfect for chat bots. Returns one result per order plus a ready-made reply text.
text | Order IDs plus what you want: status, refill, cancel or speed | 20481 20482 refill |
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=request" \
--data-urlencode "text=20481 20482 refill"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'request',
'text' => '20481 20482 refill',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "request",
"text": "20481 20482 refill",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "request",
text: "20481 20482 refill",
}),
});
console.log(await response.json());{
"results": [
{
"order": 20481,
"action": "refill",
"ok": true,
"task": 7731
}
],
"reply": "Refill requested for #20481"
}Your balance
POSTaction=balanceYour account balance on this panel.
API_KEY="YOUR_API_KEY" # from your panel: Account → API
curl -sS -X POST "https://yourbrand.cleanpanels.co.ke/api/v2" \
--data-urlencode "key=${API_KEY}" \
--data-urlencode "action=balance"<?php
$apiKey = getenv('PANEL_API_KEY'); // never hard-code your key
$ch = curl_init('https://yourbrand.cleanpanels.co.ke/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => $apiKey,
'action' => 'balance',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.post("https://yourbrand.cleanpanels.co.ke/api/v2", data={
"key": os.environ["PANEL_API_KEY"],
"action": "balance",
})
print(response.json())// Node.js 18+
const response = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({
key: process.env.PANEL_API_KEY,
action: "balance",
}),
});
console.log(await response.json());{
"balance": "184.32",
"currency": "USD"
}WhatsApp & email for any app.
Link WhatsApp numbers by QR, get messages on your webhook, send notifications, and resell branded mailboxes with one-click Cloudflare DNS. Base URL https://cleanpanels.co.ke/api/v1 · billed monthly from your wallet · 120 requests/minute per key.
Who am I
GET/meYour account, pricing tier and wallet balance. Good first call to test your key.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/me" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/me');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/me",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/me", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"id": 42,
"name": "Jane",
"email": "[email protected]",
"tier": "external",
"wallet": {
"balance": 25.5,
"currency": "USD"
}
}Wallet and transactions
GET/walletBalance and your last 50 wallet transactions. Services are paid monthly from this wallet.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/wallet" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/wallet');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/wallet",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/wallet", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"balance": 25.5,
"currency": "USD",
"transactions": [
{
"id": 901,
"amount": -5,
"balance_after": 25.5,
"type": "charge",
"description": "WhatsApp API number — first month",
"created_at": "2026-10-25T09:12:00+03:00"
}
],
"top_up_url": "https://cleanpanels.co.ke/wallet"
}Your prices
GET/pricesWhat you pay per month, including any custom reseller pricing.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/prices" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/prices');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/prices",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/prices", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"tier": "reseller",
"currency": "USD",
"custom_pricing": false,
"monthly": {
"whatsapp_number": 4,
"mailbox": 1.5
}
}Create a WhatsApp number
POST/whatsapp/instancesStarts a new number (first month charged from your wallet) and returns a QR code. Scan it in WhatsApp → Linked devices.
name | Support |
webhook_url | https://yourapp.com/whatsapp-webhook |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/whatsapp/instances" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"name":"Support","webhook_url":"https://yourapp.com/whatsapp-webhook"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Support',
'webhook_url' => 'https://yourapp.com/whatsapp-webhook',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"name": "Support",
"webhook_url": "https://yourapp.com/whatsapp-webhook",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Support",
"webhook_url": "https://yourapp.com/whatsapp-webhook"
}),
});
console.log(await response.json());{
"id": 12,
"name": "Support",
"status": "pending",
"webhook_secret": "whsec_…",
"connection": {
"status": "qr",
"qr": "data:image/png;base64,…"
}
}List numbers
GET/whatsapp/instancesAll your WhatsApp numbers with status and message counts.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/whatsapp/instances" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"data": [
{
"id": 12,
"name": "Support",
"status": "connected",
"phone": "254712345678",
"messages_in": 120,
"messages_out": 96
}
]
}Connection status / QR
GET/whatsapp/instances/{id}/qrPoll every few seconds while linking: returns a fresh QR until status becomes "connected".
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/qr" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/qr');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/qr",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/qr", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"status": "connected",
"phone": "254712345678"
}Send a message
POST/whatsapp/instances/{id}/send"to" is a phone number in international format (digits only) OR a group ID (JID) ending in @g.us from GET …/groups. In groups you can @mention people: add "mentions": ["254711111111"] and write "@254711111111" in the text. The number must be a member of the group (and an admin if only admins can send).
to | 254712345678 |
text | Your order #20481 is complete ✅ |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"to":"254712345678","text":"Your order #20481 is complete ✅"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'to' => '254712345678',
'text' => 'Your order #20481 is complete ✅',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"to": "254712345678",
"text": "Your order #20481 is complete ✅",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "254712345678",
"text": "Your order #20481 is complete ✅"
}),
});
console.log(await response.json());{
"sent": true,
"to": "254712345678",
"group": false,
"message_id": "3EB0C4A1F2"
}Send to a group
POST/whatsapp/instances/{id}/sendSame endpoint, with a group JID as "to". Get group IDs from GET …/groups. Incoming group messages arrive at your webhook with group=true, group_id, group_name and chat_id (send your reply to chat_id).
to | [email protected] |
text | New services added today 🚀 @254711111111 |
mentions | Array |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"to":"[email protected]","text":"New services added today 🚀 @254711111111","mentions":["254711111111"]}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'to' => '[email protected]',
'text' => 'New services added today 🚀 @254711111111',
'mentions' => ['254711111111'],
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"to": "[email protected]",
"text": "New services added today 🚀 @254711111111",
"mentions": ["254711111111"],
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "[email protected]",
"text": "New services added today 🚀 @254711111111",
"mentions": [
"254711111111"
]
}),
});
console.log(await response.json());{
"sent": true,
"to": "[email protected]",
"group": true,
"message_id": "3EB0C4A1F3"
}Send an image, video, document or audio
POST/whatsapp/instances/{id}/sendSame endpoint with "type" = image, video, document or audio and ONE source: "media_url" (a public https link we download; up to the full WhatsApp limit), "media_base64" (inline; whole request up to 25 MB) or "media_id" (from POST …/media; send it to many chats). Optional "caption" (up to 1024 characters; not for audio), "filename" and "mimetype" (documents), "ptt": true (audio as a voice note). Limits: image 5 MB (JPEG, PNG), video 16 MB (MP4, 3GP), audio 16 MB (OGG Opus, MP3, M4A/AAC, AMR), document 100 MB (any file). The real file type is checked. Errors: {"sent":false,"error":{"code":"media_too_large","message":"…"}}, codes: invalid_type, missing_media, ambiguous_media, invalid_media_url, media_url_blocked, media_download_failed, invalid_base64, media_not_found, media_too_large, unsupported_media_type, caption_too_long, caption_not_allowed, invalid_recipient, not_connected, rate_limited, daily_limit_reached, send_failed. Requests without media fields work exactly as before.
to | 254712345678 |
type | document |
media_url | https://yourshop.com/invoices/20481.pdf |
filename | Invoice 20481.pdf |
mimetype | application/pdf |
caption | Your invoice |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"to":"254712345678","type":"document","media_url":"https://yourshop.com/invoices/20481.pdf","filename":"Invoice 20481.pdf","mimetype":"application/pdf","caption":"Your invoice"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'to' => '254712345678',
'type' => 'document',
'media_url' => 'https://yourshop.com/invoices/20481.pdf',
'filename' => 'Invoice 20481.pdf',
'mimetype' => 'application/pdf',
'caption' => 'Your invoice',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"to": "254712345678",
"type": "document",
"media_url": "https://yourshop.com/invoices/20481.pdf",
"filename": "Invoice 20481.pdf",
"mimetype": "application/pdf",
"caption": "Your invoice",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "254712345678",
"type": "document",
"media_url": "https://yourshop.com/invoices/20481.pdf",
"filename": "Invoice 20481.pdf",
"mimetype": "application/pdf",
"caption": "Your invoice"
}),
});
console.log(await response.json());{
"sent": true,
"id": "3EB0C4A1F4",
"message_id": "3EB0C4A1F4",
"to": "254712345678",
"group": false,
"type": "document",
"size": 48213
}Upload a file to send
POST/whatsapp/instances/{id}/mediaUpload once, send many times with "media_id" (kept 3 days). Send a multipart form with a "file" field (up to 25 MB) or JSON with media_url / media_base64; "type" is optional (we detect it). GET …/media/{media_id} shows a file, DELETE removes it.
media_url | https://yourshop.com/promo.jpg |
type | image |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/media" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"media_url":"https://yourshop.com/promo.jpg","type":"image"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/media');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'media_url' => 'https://yourshop.com/promo.jpg',
'type' => 'image',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/media",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"media_url": "https://yourshop.com/promo.jpg",
"type": "image",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/media", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"media_url": "https://yourshop.com/promo.jpg",
"type": "image"
}),
});
console.log(await response.json());{
"media_id": "9f2c…",
"type": "image",
"mimetype": "image/jpeg",
"filename": "promo.jpg",
"size": 182311,
"url": "https://cleanpanels.co.ke/wa-media/9f2c…",
"expires_at": "2026-12-01T10:00:00+00:00"
}List groups
GET/whatsapp/instances/{id}/groupsGroups this number is a member of. "id" is the group JID to send to. can_send=false means only admins may post there. Cached for 2 minutes; add ?refresh=1 after joining a new group.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/groups" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/groups');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/groups",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/groups", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"data": [
{
"id": "[email protected]",
"name": "VIP Customers",
"participants": 148,
"is_admin": true,
"admins_only": false,
"can_send": true
}
]
}Change settings
PATCH/whatsapp/instances/{id}Change name, webhook_url or respond_groups.
webhook_url | https://yourapp.com/new-webhook |
respond_groups | false |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X PATCH "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"webhook_url":"https://yourapp.com/new-webhook","respond_groups":false}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => 'https://yourapp.com/new-webhook',
'respond_groups' => false,
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"PATCH",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"webhook_url": "https://yourapp.com/new-webhook",
"respond_groups": False,
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"webhook_url": "https://yourapp.com/new-webhook",
"respond_groups": false
}),
});
console.log(await response.json());{
"id": 12,
"name": "Support",
"webhook_url": "https://yourapp.com/new-webhook",
"respond_groups": false
}Recent messages
GET/whatsapp/instances/{id}/messagesThe last 100 messages in and out.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/messages" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/messages');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/messages",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12/messages", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"data": [
{
"direction": "in",
"peer": "254712345678",
"text": "20481 status",
"status": "received",
"created_at": "2026-10-25T10:01:00+03:00"
}
]
}Unlink / delete
DELETE/whatsapp/instances/{id}Deletes the number and stops billing. Use POST …/12/logout to only unlink the phone.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X DELETE "https://cleanpanels.co.ke/api/v1/whatsapp/instances/12" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/whatsapp/instances/12');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"DELETE",
"https://cleanpanels.co.ke/api/v1/whatsapp/instances/12",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/whatsapp/instances/12", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"deleted": true
}Add an email domain
POST/email/domainsCreates the domain and its DKIM key (ready in about a minute). Returns the DNS records to publish.
domain | brandx.com |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/email/domains" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"domain":"brandx.com"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/domains');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'brandx.com',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/email/domains",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"domain": "brandx.com",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/domains", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"domain": "brandx.com"
}),
});
console.log(await response.json());{
"id": 42,
"domain": "brandx.com",
"status": "provisioning",
"dns_records": [
{
"type": "TXT",
"name": "brandx.com",
"value": "v=spf1 a mx ip4:… ~all"
}
]
}One-click DNS with Cloudflare
POST/email/domains/{id}/cloudflareYour customer's Cloudflare token (template "Edit zone DNS") — used once, never stored. Merges SPF, adds DKIM and DMARC, and MX only if receive_mail is true.
api_token | CLOUDFLARE_TOKEN |
receive_mail | true |
replace_mx | false |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/email/domains/42/cloudflare" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"api_token":"CLOUDFLARE_TOKEN","receive_mail":true,"replace_mx":false}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/domains/42/cloudflare');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'api_token' => 'CLOUDFLARE_TOKEN',
'receive_mail' => true,
'replace_mx' => false,
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/email/domains/42/cloudflare",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"api_token": "CLOUDFLARE_TOKEN",
"receive_mail": True,
"replace_mx": False,
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/domains/42/cloudflare", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"api_token": "CLOUDFLARE_TOKEN",
"receive_mail": true,
"replace_mx": false
}),
});
console.log(await response.json());{
"cloudflare": {
"zone": "brandx.com",
"changes": [
"Updated your SPF record to include our server",
"Added DKIM record",
"Added DMARC record",
"Added MX record — email to brandx.com now arrives here"
]
},
"can_send": true,
"can_receive": true
}Live DNS check
GET/email/domains/{id}/dnsChecks every record against public DNS. Each has status ok | missing | wrong | warn | info, what was found, and a fix.
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X GET "https://cleanpanels.co.ke/api/v1/email/domains/42/dns" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/domains/42/dns');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"GET",
"https://cleanpanels.co.ke/api/v1/email/domains/42/dns",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/domains/42/dns", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"summary": {
"can_send": false,
"can_receive": false,
"inbox_ready": false,
"records": {
"spf": "wrong",
"dkim": "ok",
"dmarc": "warn",
"mx": "info"
}
},
"dns_check": [
{
"key": "spf",
"status": "wrong",
"message": "Your SPF record does not include our server yet. Replace it with:",
"suggest": "v=spf1 ip4:… include:_spf.google.com ~all"
}
]
}Create a mailbox
POST/email/mailboxesOn your verified domain (domain_id) or the shared domain ("domain":"shared"). The password is shown only once.
domain_id | 42 |
name | support |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/email/mailboxes" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"domain_id":42,"name":"support"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/mailboxes');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'domain_id' => 42,
'name' => 'support',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/email/mailboxes",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"domain_id": 42,
"name": "support",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/mailboxes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"domain_id": 42,
"name": "support"
}),
});
console.log(await response.json());{
"id": 7,
"address": "[email protected]",
"status": "provisioning",
"smtp": {
"host": "mail.cleanpanels.co.ke",
"port_ssl": 465,
"port_tls": 587,
"username": "[email protected]",
"password": "…",
"imap_host": "mail.cleanpanels.co.ke",
"imap_port": 993
}
}Forwarding, auto-reply, aliases, size
PATCH/email/mailboxes/{id}Send only what you want to change. forward_to: up to 10 addresses ([] = off); keep_copy: false forwards without storing; aliases: extra addresses delivering to this mailbox; quota_mb: 512, 1024 or 2048; password: set your own (10+ letters and numbers). Live within a minute.
forward_to | Array |
keep_copy | true |
autoreply | Array |
aliases | Array |
quota_mb | 2048 |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X PATCH "https://cleanpanels.co.ke/api/v1/email/mailboxes/7" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"forward_to":["[email protected]"],"keep_copy":true,"autoreply":{"enabled":true,"message":"Thanks! We reply within 24 hours."},"aliases":["sales","hello"],"quota_mb":2048}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/mailboxes/7');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'forward_to' => ['[email protected]'],
'keep_copy' => true,
'autoreply' => [
'enabled' => true,
'message' => 'Thanks! We reply within 24 hours.',
],
'aliases' => ['sales', 'hello'],
'quota_mb' => 2048,
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"PATCH",
"https://cleanpanels.co.ke/api/v1/email/mailboxes/7",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"forward_to": ["[email protected]"],
"keep_copy": True,
"autoreply": {
"enabled": True,
"message": "Thanks! We reply within 24 hours.",
},
"aliases": ["sales", "hello"],
"quota_mb": 2048,
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/mailboxes/7", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"forward_to": [
"[email protected]"
],
"keep_copy": true,
"autoreply": {
"enabled": true,
"message": "Thanks! We reply within 24 hours."
},
"aliases": [
"sales",
"hello"
],
"quota_mb": 2048
}),
});
console.log(await response.json());{
"id": 7,
"address": "[email protected]",
"status": "active",
"settings": {
"forward_to": [
"[email protected]"
],
"keep_copy": true,
"autoreply": {
"enabled": true,
"message": "Thanks! We reply within 24 hours."
},
"aliases": [
"[email protected]",
"[email protected]"
],
"quota_mb": 2048,
"state": "syncing"
},
"changed": [
"forwarding",
"auto-reply",
"aliases",
"storage"
]
}Catch-all for a domain
PATCH/email/domains/{id}Mail to any address @domain that does not exist is delivered here instead of bouncing. Send null to turn it off.
catchall | [email protected] |
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X PATCH "https://cleanpanels.co.ke/api/v1/email/domains/42" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"catchall":"[email protected]"}'<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/domains/42');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'catchall' => '[email protected]',
]),
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"PATCH",
"https://cleanpanels.co.ke/api/v1/email/domains/42",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
json={
"catchall": "[email protected]",
},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/domains/42", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"catchall": "[email protected]"
}),
});
console.log(await response.json());{
"id": 42,
"domain": "brandx.com",
"status": "active",
"catchall": "[email protected]",
"can_send": true,
"can_receive": true
}New mailbox password
POST/email/mailboxes/{id}/reset-passwordGenerates a new password (takes effect within a minute).
API_KEY="sk_live_YOUR_KEY" # Console → API keys
curl -sS -X POST "https://cleanpanels.co.ke/api/v1/email/mailboxes/7/reset-password" \
-H "Authorization: Bearer ${API_KEY}"<?php
$apiKey = getenv('CLEANPANELS_API_KEY'); // never hard-code your key
$ch = curl_init('https://cleanpanels.co.ke/api/v1/email/mailboxes/7/reset-password');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);import os, requests
response = requests.request(
"POST",
"https://cleanpanels.co.ke/api/v1/email/mailboxes/7/reset-password",
headers={"Authorization": "Bearer " + os.environ["CLEANPANELS_API_KEY"]},
)
print(response.json())// Node.js 18+
const response = await fetch("https://cleanpanels.co.ke/api/v1/email/mailboxes/7/reset-password", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLEANPANELS_API_KEY}`,
"Content-Type": "application/json",
},
});
console.log(await response.json());{
"password": "…",
"note": "Takes effect within a minute."
}All endpoints
| GET | /me · /wallet · /prices | Account, balance and transactions, your monthly prices |
| GET · POST | /whatsapp/instances | List / create numbers |
| GET · PATCH · DELETE | /whatsapp/instances/{id} | Details (with connection) / change settings / delete |
| POST | /whatsapp/instances/{id}/connect · /logout | Start linking / unlink the phone |
| GET | /whatsapp/instances/{id}/qr · /messages | QR + status / last 100 messages |
| POST | /whatsapp/instances/{id}/send · /rotate-secret | Send a text / new webhook secret |
| GET · POST | /email/domains | List / add sending domains |
| GET · PATCH · DELETE | /email/domains/{id} | Details with DNS records and access info / set catch-all / remove |
| POST · GET | /email/domains/{id}/verify · /dns | Re-check and save / live per-record check with fixes |
| POST | /email/domains/{id}/cloudflare | One-click DNS with the customer's Cloudflare token |
| GET · POST | /email/mailboxes | List / create mailboxes |
| GET · PATCH · DELETE | /email/mailboxes/{id} | Details with settings / forwarding, auto-reply, aliases, size, password / delete |
| POST | /email/mailboxes/{id}/reset-password | New password |
DNS check statuses: ok · missing · wrong · warn (recommended) · info (optional, e.g. MX pointing to Google). Mail apps connect with IMAP 993 · POP3 995 · SMTP 465 (SSL) or 587 (STARTTLS) — returned as access on every domain.
Answer WhatsApp messages from your own code.
Each incoming message is POSTed as JSON to your number's webhook_url, signed with X-Signature: sha256=HMAC_SHA256(raw body, webhook_secret). Reply within 10 seconds with {"reply":"…"} to answer, or {} to stay silent.
If your server can't be reached, times out or answers 5xx/429, we keep the message and try again after 30 s, 2 min, 5 min, 15 min and 30 min, and your reply is still sent to the chat. Messages that waited on WhatsApp while the number was reconnecting are delivered too, with "delayed": true and the time the customer sent them in timestamp. The same message can reach you more than once, so use message_id to skip ones you've already handled. Any other 4xx answer counts as a deliberate rejection and isn't retried.
<?php
// webhook.php — set this URL as your number's webhook_url
$secret = getenv('WA_WEBHOOK_SECRET'); // from the create response
$raw = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_SIGNATURE'] ?? '';
if (!hash_equals('sha256=' . hash_hmac('sha256', $raw, $secret), $sig)) {
http_response_code(401);
exit;
}
$msg = json_decode($raw, true); // event, from, name, text, group, group_id, chat_id, timestamp
header('Content-Type: application/json');
if (stripos($msg['text'], 'hello') !== false) {
echo json_encode(['reply' => 'Hi ' . $msg['name'] . '! How can we help?']);
} else {
echo '{}'; // stay silent
}# Flask
import hmac, hashlib, os
from flask import Flask, request, jsonify
app = Flask(__name__)
SECRET = os.environ["WA_WEBHOOK_SECRET"].encode()
@app.post("/whatsapp-webhook")
def whatsapp():
raw = request.get_data()
expected = "sha256=" + hmac.new(SECRET, raw, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, request.headers.get("X-Signature", "")):
return "", 401
msg = request.get_json() # event, from, name, text, group, group_id, chat_id, timestamp
if "hello" in msg["text"].lower():
return jsonify(reply=f"Hi {msg['name']}! How can we help?")
return jsonify({}) # stay silent// Express
import express from "express";
import crypto from "crypto";
const app = express();
app.post("/whatsapp-webhook", express.raw({ type: "application/json" }), (req, res) => {
const expected = "sha256=" + crypto.createHmac("sha256", process.env.WA_WEBHOOK_SECRET)
.update(req.body).digest("hex");
const got = req.get("X-Signature") || "";
if (got.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected))) {
return res.sendStatus(401);
}
const msg = JSON.parse(req.body); // event, from, name, text, group, group_id, chat_id, timestamp
if (msg.text.toLowerCase().includes("hello")) return res.json({ reply: `Hi ${msg.name}! How can we help?` });
res.json({}); // stay silent
});
app.listen(3000);{
"event": "message",
"instance_id": 12,
"from": "254712345678",
"from_is_lid": false,
"name": "Jane",
"text": "hello, is my order done?",
"group": false,
"group_id": "",
"chat_id": "254712345678",
"timestamp": 1761300000,
"message_id": "3EB0C431D2A1F8E9B7",
"delayed": false,
"attempt": 1
}POST /whatsapp/instances/{id}/rotate-secret.Complete examples you can run today.
Copy, add your key, run. Each one is short enough to understand — and to hand to an AI if you want to change it.
An order form on your website
Save as order.php on your site. Customers enter a link and quantity; the order is placed on your panel and they see the order number.
<?php
// order.php — set PANEL_API_KEY in your hosting's environment settings
$apiUrl = 'https://yourbrand.cleanpanels.co.ke/api/v2';
$serviceId = 1042; // the service to sell, from action=services
$message = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => getenv('PANEL_API_KEY'),
'action' => 'add',
'service' => $serviceId,
'link' => $_POST['link'] ?? '',
'quantity' => (int) ($_POST['quantity'] ?? 0),
]),
]);
$r = json_decode((string) curl_exec($ch), true);
$message = isset($r['order']) ? 'Thank you! Your order number is #' . $r['order'] : 'Sorry: ' . ($r['error'] ?? 'please try again');
}
?>
<form method="post">
<input name="link" placeholder="Your profile or post link" required>
<input name="quantity" type="number" min="10" value="1000" required>
<button>Order now</button>
</form>
<p><?= htmlspecialchars($message) ?></p>Check all open orders and request refills
Checks up to 100 orders in one call, then asks for a refill on partial orders. Run it hourly with cron or Task Scheduler.
# pip install requests
import os, requests
API = "https://yourbrand.cleanpanels.co.ke/api/v2"
KEY = os.environ["PANEL_API_KEY"]
my_orders = [20481, 20482, 20483] # load these from your own records
def call(**fields):
return requests.post(API, data={"key": KEY, **fields}, timeout=30).json()
statuses = call(action="status", orders=",".join(map(str, my_orders)))
for order_id, info in statuses.items():
if "error" in info:
print(order_id, "→", info["error"])
continue
print(order_id, info["status"], "remains:", info["remains"])
if info["status"] == "Partial":
result = call(action="refill", order=order_id)
print(" refill:", result.get("refill") or result.get("error"))Reply to customers with their order status
When a customer sends an order number on WhatsApp, your webhook asks your panel and replies instantly. Uses the plain-language request action, so "20481 refill" works too.
// npm install express · node --env-file=.env bot.js
import express from "express";
import crypto from "crypto";
const app = express();
app.post("/whatsapp-webhook", express.raw({ type: "application/json" }), async (req, res) => {
const expected = "sha256=" + crypto.createHmac("sha256", process.env.WA_WEBHOOK_SECRET).update(req.body).digest("hex");
const got = req.get("X-Signature") || "";
if (got.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected))) return res.sendStatus(401);
const msg = JSON.parse(req.body);
if (msg.group || !/\d{3,}/.test(msg.text)) return res.json({}); // no order number → stay silent
const r = await fetch("https://yourbrand.cleanpanels.co.ke/api/v2", {
method: "POST",
body: new URLSearchParams({ key: process.env.PANEL_API_KEY, action: "request", text: msg.text }),
}).then((x) => x.json());
res.json({ reply: r.reply || r.error || "Sorry, I couldn't find that order." });
});
app.listen(3000, () => console.log("Bot listening on :3000"));Pay monthly from your wallet.
| Panel owners | External | |
|---|---|---|
| WhatsApp number | $5.00/mo | $7.00/mo |
| Mailbox | $2.00/mo | $4.00/mo |
The Panel API is free on every panel. Top up with M-PESA & mobile money, cards or Binance USDT. Reseller pricing available — talk to us.
Let other panels resell you
List your panel in the provider marketplace. It appears inside every panel's Providers page on the platform — boost it to be featured at the top, and track impressions and clicks in your console.
See the marketplaceBuild on your own panel.
Launch a panel and get your API key in under a minute.
Launch my panel