Skip to main content
1

Create the instance

Call PUT /instances/create with JWT to create the instance and receive id and token.
2

Ensure billing

Use POST /instances/{id}/subscribe to activate the subscription (default API direct flow with a default card on file).
3

Pair WhatsApp

Call GET /instances/{id}/session/qr (repeat until pairing completes) or use GET /instances/{id}/session/paircode/{phone} for the phone-code flow. This starts the worker flow; there is no separate connect call.
4

Send and receive events

Configure the webhook, send messages, and track status via the API endpoints.

Short example

# 1. create
curl -X PUT "https://api.vzaps.com/instances/create" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name":"My instance"}'

# 2. subscribe (direct API flow; requires default card on Stripe)
curl -X POST "https://api.vzaps.com/instances/INSTANCE_ID/subscribe" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{}'

# 3. QR / pairing (GET starts the worker flow; repeat until the account is active)
curl -X GET "https://api.vzaps.com/instances/INSTANCE_ID/session/qr" \
  -H "X-Instance-Token: INSTANCE_TOKEN" \
  -H "X-Client-Token: YOUR_CLIENT_TOKEN"

What to expect at each step

  • create: returns the instance token and initial commercial status.
  • subscribe: in normal API usage, returns mode: "direct" when the subscription is created with the default card.
  • session/qr: when the WhatsApp account is not authenticated yet, returns a QRCode data URL; repeat the GET until pairing completes.
  • session/status: returns only data.connected: true when the instance is connected to WhatsApp (account authenticated), false otherwise.

Cancellation and resume

  • Use PUT or DELETE /instances/{id}/cancel to cancel the instance via the public API.
  • Use POST /instances/{id}/resume-subscription to reverse an end-of-period cancellation if you scheduled one.

After onboarding

When the instance is active and connected, you can:
  • configure and query the webhook;
  • send messages, files, links, lists, and buttons;
  • query users, groups, contacts, and message queues;
  • use session/status to check WhatsApp connectivity and monitor queues via the queue endpoints.