API Reference
The single source of truth is the OpenAPI spec (packages/sdk/openapi.yaml),
which generates the TypeScript SDK and this reference. Below are the core endpoints
with real examples. Authenticate with Authorization: Bearer bz_live_....
Send text — POST /messages/text
Only to and body are required. Don't pass a source number and bZapper picks one from your
pool (load spreading + conversation affinity):
curl -X POST https://api.bzapper.com.br/messages/text \
-H "Authorization: Bearer $BZ_KEY" -H "Content-Type: application/json" \
-d '{"to":"+5511988888888","body":"Hello","client_reference":"lead-42"}'
import requests
requests.post("https://api.bzapper.com.br/messages/text",
headers={"Authorization": f"Bearer {key}"},
json={"to": "+5511988888888", "body": "Hello"})
await fetch("https://api.bzapper.com.br/messages/text", {
method: "POST",
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
body: JSON.stringify({ to: "+5511988888888", body: "Hello" }),
});
<?php
$ch = curl_init("https://api.bzapper.com.br/messages/text");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $key", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["to" => "+5511988888888", "body" => "Hello"]),
CURLOPT_RETURNTRANSFER => true,
]);
$res = curl_exec($ch);
Response 202: { "message_id": "...", "status": "queued", "client_reference": "lead-42" }.
instance_id is optionalinstance_id (and pool_id) are not required. Omit them and the gateway picks the number
(rotation/sticky). Pass instance_id only to force a specific number — e.g.
{"instance_id":"<id>","to":"...","body":"..."}. See List numbers
to get the ids. Behavior details in Support flows.
List numbers — GET /instances
Lists the project's instances (numbers), with the id you use as instance_id for targeted
sends. Requires the instances:read scope.
curl https://api.bzapper.com.br/instances -H "Authorization: Bearer $BZ_KEY"
{ "data": [
{ "id": "ce…", "phone": "+5511…", "nickname": "Support", "status": "connected", "health_score": 100 }
] }
In the admin, the Numbers screen shows each number's
instance_idwith a copy button.
Other core endpoints
POST /messages/{image,video,document,audio,sticker,location,contact,poll,reaction,buttons,list}POST /messages/otp— verification code in 2 messages (text + the code bubble); counts as 1 send. The code is never persisted or shown in the inbox (masked + echoguard). If you omitbody, the API generates the text in the account's language. Details in Message types → OTP.POST /contacts/check—IsOnWhatsApp(handles@lid)GET /conversations?instance_id=andGET /conversations/{jid}/messages— inboxGET /media/{id}— a stable reference to received media (private): responds with 302 to a fresh pre-signed URL. See Message types.POST /webhooks— register a webhook (HMAC); see the webhooks guideGET /stream— real-time SSEGET /usage— usage telemetryGET /me/entitlements·GET /me/subscription·GET /me/invoices— the account's plan, limits and invoices; see Billing
Errors
Every error has a stable neutral code plus a translated message:
{ "code": "instance_not_connected", "message": "Number disconnected...", "locale": "en" }
Use the code in your logic. Common ones: unauthorized, forbidden,
rate_limited, not_connected, no_number_available, not_supported
(experimental).