Skip to content

WhatsApp API mode: send and receive from your own system

API keys, the webhook, sending messages, media, templates and group chats, with example values.

On this page

When to use API mode

Choose API mode when your own system (an online shop, a booking system, an ERP) should handle the messages. Every message a customer sends goes to your webhook; your system replies through the SaleFlowPoint API. No AI is used, so API mode uses no AI tokens. Price: $19 a month or $199 a year per number.

After you switch a number to API mode, API and webhooks appears in the WhatsApp menu. Each number in API mode has its own webhook, secret and delivery log.

Make an API key

  1. Open WhatsApp > API and webhooks and scroll to the keys.
  2. Type a name, for example Online shop, and create the key.
  3. Copy the key now. It is shown only once and starts with sfp_live_.
  4. Keep it on your server only, never in a browser or a phone app.

Revoking a key stops every system that uses it at once, and cannot be undone. One key works for the whole WhatsApp API and the company agent API.

Limits on a key (optional)

Tick Set limits when you make a key, or press Limits on a key later and Save limits. A key with no limits keeps full access, never expires and works from any address, as before.

  • Scopes: untick Full access (every endpoint) and choose only what the system needs, for example wa:send for a system that only sends, or agent:bookings for a booking chatbot. A call outside the key's scopes answers 403 api_key_scope_missing.
  • Expires on (optional, end of day UTC): after that day the key answers 401 api_key_expired. Make the next key before the date.
  • Allowed IPs (optional): one IPv4 or IPv6 address or CIDR range per line, up to 20. A call from any other address answers 403 api_key_ip_not_allowed. One wrong line stops the whole save.

Every scope is listed in the developer docs.

The API keys card with one key named Online shop and the Send a message example
One API key, Online shop, and the send example shown on the same page.

Set the webhook

  1. Pick the number, for example +1 207-555-0177.
  2. Enter the Webhook URL (https), for example https://orders.harborstreet.example/whatsapp. Public addresses only; SaleFlowPoint waits up to 10 seconds for a 2xx answer.
  3. Tick the events: message.received (a customer wrote), message.status (sent, delivered, read or failed), and group.updated if you use groups.
  4. Save, copy the signing secret (shown once), then click Send a test event and check Recent deliveries.

Every delivery carries X-SFP-Signature: t=<unix seconds>,v1=<hex>: the HMAC-SHA256 of t + "." + raw body with your signing secret. Check it in constant time and refuse timestamps older than 5 minutes. A new secret is shown once; the old one keeps working for 24 hours so your system can switch over. Login (optional) adds a saved login if your address needs one.

The webhook form with the URL, the events, the signing secret and recent deliveries
The webhook of the API number, with two delivered events in Recent deliveries.

Send a message

Send with POST /api/v1/wa/messages on saleflowpoint.com. Use an Idempotency-Key header so a retry never sends twice.

Send a text
curl -X POST https://saleflowpoint.com/api/v1/wa/messages \
  -H "Authorization: Bearer sfp_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-ready" \
  -d '{"to": "12075550142", "type": "text", "text": "Your order WA-1042 is ready for pickup."}'

Free text can only be sent inside the 24-hour window after the customer last wrote. Outside it, send an approved template (type: "template"). With several API numbers add number_id. reply_to with a message id quotes the customer's message.

Message types: text, template, image, video, audio, document, sticker, location, contacts, buttons, list and reaction. Rate limit: 300 requests a minute per key.

Media and templates

AttachmentFormatsLargest
ImageJPEG, PNG5 MB
VideoMP4, 3GPP16 MB
AudioAAC, MP4, MPEG, AMR, OGG16 MB
DocumentPDF, text, Word, Excel, PowerPoint20 MB upload (up to 100 MB by https link)

Upload with POST /wa/media, then send the returned id. Download a customer's attachment with GET /wa/media/{id}; only attachments that came in on your own numbers are served, and Meta keeps them for about 30 days. GET /wa/templates lists your approved templates; POST /wa/messages/{wamid}/read shows the customer blue ticks; GET /wa/conversations gives the history.

Group chats (Official Business Accounts only)

Group chats work only on numbers with an Official Business Account (the blue badge). A number also used in the WhatsApp Business app (connected with the QR code) cannot use groups: group calls answer 409 group_not_available.

  • A group holds up to 8 participants, who join only by the group's invite link.
  • POST /groups answers 202 with status creating; a group.updated event brings the invite link when WhatsApp has made it.
  • Send to a group with group_id instead of to (text, template, image, video, audio, document).
  • Group chats never get the chatbot or a custom chatbot and do not appear in the Inbox's contact list.

Every part of the API and webhooks page

At the top, Number picks which API-mode number the page shows (with several), and Developer docs opens the full reference. With no number in API mode the page says so and points to the Numbers page.

PanelFields and optionsLimits and defaults
Your webhookWebhook URL (https); Signing secret with Rotate secret and How to verify it; Login (optional), None: signature only or a saved Connection; Events to send; Save; Send a test eventURL up to 500 characters, public addresses only; we wait up to 10 seconds for a 2xx answer. A login is sent only to its own host, with the signature
Recent deliveriesTime, Event (with its event id), Result, Tries; ReplayResult is the answer code (for example 200 OK), Failed with the last error, Waiting, or the next try time. Replay is not offered while a delivery is still waiting
API keysEach key's name; Revoke; New key name; New keyName up to 60 characters. The key is shown once. Revoking stops systems using it at once and cannot be undone
Send a messageA ready curl example for this numberFree text only inside the 24-hour window after the customer wrote; otherwise send an approved template

Full API reference

Every endpoint, with examples in curl, Node.js, Python and PHP and a Try it panel, is in the WhatsApp API developer guide.

Worked examples

Next: Chatbot mode · All WhatsApp guide pages

Try WhatsApp free for 7 days

Register your shop, connect a WhatsApp Business number and start the trial.

Loading SaleFlowPoint…