How it works
You POST a small JSON body to your send endpoint. WAGHL creates the outbound message in the contact's GHL conversation, and GHL then sends it out over WhatsApp through the normal flow — the same path a message typed in GHL follows.
1. Find your endpoint
Which URL you POST to depends on the WhatsApp gateway your sub-account is on. To check: in GHL, go to Settings → Phone Numbers → Advanced Setting and note the provider.
| Provider | Endpoint URL |
|---|---|
| WhatsApp Gateway 1 | https://app1.waghl.com/public/wa-send.php |
| WA1 Connector | https://wa1.waconnector.com/public/wa-send.php |
| WA2 Connector | https://wa2.waconnector.com/public/wa-send.php |
2. Get your API key
Every send needs your sub-account's API key, which identifies the account you're sending from. To find it, an admin opens the WAGHL admin panel and:
Open the sub-account's users
Go to Sub-accounts, find the account, and open Users.
Open the view
Click the view icon in the Action column for the user.
Copy the API Key
The key is shown under API Key. Copy it — you'll paste it into your request.
3. Send a message
Make a POST request with a JSON body. Set Content-Type: application/json.
Text message
POST https://wa1.waconnector.com/public/wa-send.php
Content-Type: application/json
{
"api_key": "YOUR_API_KEY",
"number": "919876543210",
"message": "Hello from the API 👋"
}
| Field | Required | What it is |
|---|---|---|
api_key | Yes | Your sub-account API key (from step 2) |
number | Yes | Recipient's WhatsApp number, digits with country code, no + (e.g. 919876543210) |
message | Yes* | The text to send. *Optional if you're sending media. |
media_type | No | image, video, audio, or document |
url | No | Public URL of the media file. Required when media_type is set. |
Sending media
To send an image, video, audio, or document, add media_type and a public url. The message then becomes an optional caption.
{
"api_key": "YOUR_API_KEY",
"number": "919876543210",
"message": "Here's the brochure",
"media_type": "document",
"url": "https://example.com/files/brochure.pdf"
}
url you provide, so it can't be behind a login or on a private network. If the file won't load in an incognito browser tab, it won't send.
4. Read the response
A successful request returns 200 with the GHL message it created:
{
"success": true,
"message": "Outbound message processed",
"messageId": "6tL0MldX02XrtkLGq9Cr",
"locationId": "APKKX7aJ2XUy4BezKrlz"
}
messageId is the GHL conversation message. The actual WhatsApp send happens a moment later, asynchronously, when GHL fires it out over your connected number — so the response confirms the message was accepted and recorded, not that WhatsApp has delivered it yet.
If something's wrong, you get a 4xx with a reason:
{
"success": false,
"message": "Contact not found for this number in GHL. The contact must exist before sending."
}
How API sends look in GHL
Messages sent through the API carry a small ☑️via API tag in the GHL conversation, so you can tell them apart from messages typed in GHL or sent from a phone. The tag is only visible inside GHL — the WhatsApp recipient sees clean text without it.
Troubleshooting
| Response | What to check |
|---|---|
| "Contact not found for this number in GHL" | The number isn't a contact in that sub-account yet. Create it in GHL first, then send. Make sure the number format matches (country code, no +). |
| Invalid or missing API key | Re-copy the key from the admin panel (step 2). If it was regenerated, the old key no longer works — update it in your request. |
| Message accepted but never arrives on WhatsApp | Confirm the sub-account's WhatsApp number is connected, and that you're posting to the correct gateway endpoint for that account. |
| Media doesn't send | The url must be publicly downloadable and media_type must be set. Test the URL in an incognito tab. |
| Empty request / 400 | Set Content-Type: application/json and send a valid JSON body. A malformed body is read as empty. |
What's next?
- Premium actions & webhook — trigger sends from GHL workflows
- Spintax messaging — vary your message text automatically
- Connect unlimited numbers — add more sending numbers