Skip to main content

Before you begin

You’ll need three things in place before making your first API call:
You need a Connectly business account and a business ID to scope your API requests. Your API key authenticates every request — contact your Account Manager if you don’t have one yet, or generate one from the Connectly Dashboard at any time.
Keep your API key secret. Never commit it to source control or expose it in client-side code. If a key is compromised, regenerate it immediately from the Dashboard.
You need a verified Facebook Business Manager account with admin access. Meta uses this to own and manage your WhatsApp Business Account, and to review and approve your message templates.
A WABA is required to send and receive WhatsApp messages as a business. Connectly is a WhatsApp BSP (Business Service Provider) and can onboard you directly from the Connectly inbox. To register a WABA you’ll need:Your Account Manager will walk you through the registration once these are in place.

Step 1: Authenticate your requests

Every Connectly API request must include your API key as an X-API-Key header. There are no session tokens or OAuth flows — just a single header on every call.
Any request missing a valid X-API-Key header returns an ERROR_TYPE_AUTHENTICATION error.

Step 2: Send a template message

Template messages are pre-approved message formats managed in your Facebook Business Manager. They are not subject to the 24-hour reply window — you can send them to any customer at any time, even if they have never messaged you before.
Your template must be created and approved in Facebook Business Manager before you can use it in an API call. Contact the Connectly team if you need help getting a template approved.
Request fields Response
The id is your message ID. Use it to correlate delivery status events if you’re subscribed to webhooks.

Step 3: Reply with a session message

Once a customer messages you, a 24-hour session window opens. During that window you can send free-form session messages — no template or pre-approval needed.
If the customer hasn’t messaged you in the last 24 hours — or has never messaged you at all — you must use a template message instead. The session endpoint will return an error outside this window.
Response
Add an optional sender object ({ "id": "+14151111234", "channelType": "whatsapp" }) to choose which of your WhatsApp numbers sends the message. If omitted, Connectly uses your default number.

Which message type should I use?