Skip to main content

Quickstart — your first message in 5 minutes

You'll connect a number and send your first message.

1. Get your API key

In the admin panel (or with the super-admin), create an API key for your tenant. It becomes Authorization: Bearer bz_live_... on every call.

2. Create a number and connect it via QR

# create the instance (number)
curl -X POST https://api.bzapper.com.br/instances \
-H "Authorization: Bearer $BZ_KEY" -H "Content-Type: application/json" \
-d '{"phone":"+5511999999999","nickname":"sales"}'

# start the connection via QR (or ?method=code for a pairing code)
curl -X POST "https://api.bzapper.com.br/instances/$ID/connect?method=qr" \
-H "Authorization: Bearer $BZ_KEY"

The response carries qr_code. Render it as a QR image and scan it in WhatsApp under Linked devices → Link a device. Track the status:

curl "https://api.bzapper.com.br/instances/$ID" -H "Authorization: Bearer $BZ_KEY"
# status: qr_pending → connecting → connected (a fresh number enters "warming")

Tip: open the SSE stream (GET /stream) and watch the status change in real time.

3. Send your first message

curl -X POST https://api.bzapper.com.br/messages/text \
-H "Authorization: Bearer $BZ_KEY" -H "Content-Type: application/json" \
-d '{"instance_id":"'$ID'","to":"+5511988888888","body":"Hello from bZapper! 🐝"}'

Done. The status envelope (message.sent/delivered/read) arrives through the webhooks and the SSE stream, with your client_reference echoed end to end.

Next: validating webhooks (HMAC).