REST API and webhooks
Connect WhatsApp to your CRM, POS or software
A simple JSON REST API to send messages and approved templates, create contacts, reply in a conversation, launch a campaign or add an appointment; plus signed webhooks to receive every event on your side.
The API and webhooks are part of the Agency plan. Google Sheets and stores connect without code on every plan.
Get started in three steps
- 1
Create a key
In automatesend, Integrations → API: the “as_live_…” key is shown only once. Keep it server-side.
- 2
Call the API
Over HTTPS with JSON and the Authorization: Bearer header. Moroccan numbers are accepted as written (0661234567).
- 3
Receive events
Add your server's address and pick the events: messages, orders, appointments, campaigns…
Examples
Every request uses the Authorization: Bearer as_live_... header and JSON.
Send an approved template
curl -X POST https://automatesend.com/api/v1/messages \
-H "Authorization: Bearer as_live_..." \
-H "Content-Type: application/json" \
-d '{ "to": "0661234567", "template": "confirmation_commande",
"language": "fr", "variables": ["Salma", "#1024", "539 DH"] }'Reply with free text (customer wrote less than 24 hours ago)
curl -X POST https://automatesend.com/api/v1/messages \
-H "Authorization: Bearer as_live_..." -H "Content-Type: application/json" \
-d '{ "to": "0661234567", "text": "Votre colis part demain." }'Create or update a contact
curl -X POST https://automatesend.com/api/v1/contacts \
-H "Authorization: Bearer as_live_..." -H "Content-Type: application/json" \
-d '{ "phone": "0661234567", "first_name": "Salma", "tags": ["VIP"] }'Endpoints
https://automatesend.com/api/v1
POST/messagesSend an approved templateGET/messages/IDstatus of a message (sent, delivered, read, failed)POST/contactsCreate or update a contactGET/contacts?phone=0661234567find a contact (paginationlimit,cursor)GET/conversations?status=openlist conversations (filtersstatus,needs_human,phone)GET/conversations/ID/messagesmessages of a conversation, newest firstPOST/conversations/ID/messagesreply with free text in the conversation (within 24 hours)POST/conversations/ID/templatesend an approved template in the conversationGET/campaignslist campaigns with their figuresPOST/campaigns/ID/launchlaunch a scheduled campaign right away, or resume a paused oneGET/analytics/overview?from=…&to=…overview: messages, read rate, conversations, orders, Meta costGET · POST/appointmentslist or add appointments (the customer gets the reminder)
Webhooks
automatesend sends a JSON POST to your address for each event you selected.
message.receivedMessage received from a customermessage.sentMessage sent (team, assistant, automations, API)message.statusStatus of a sent message (delivered, read, failed)contact.createdNew contactcontact.unsubscribedContact unsubscribedconversation.openedConversation opened (new or reopened)conversation.closedConversation closed by the teamconversation.handoffConversation handed to the team by the assistantcampaign.launchedCampaign launchedcampaign.completedCampaign completed (with its figures)order.createdOrder receivedorder.confirmedOrder confirmed by the customerorder.cancelledOrder cancelled by the customerorder.reviewedCustomer review after deliverylink.clickedClick on a tracked linkappointment.bookedAppointment bookedappointment.rescheduledAppointment rescheduledappointment.confirmedAppointment confirmed by the customerappointment.cancelledAppointment cancelledform.submittedWhatsApp form submitted
Each webhook includes the X-Automatesend-Signature: sha256=… header: the HMAC-SHA256 of the raw body with the webhook secret. Compare it before handling the event. On error (response other than 2xx), delivery is retried 3 times.
Errors and limits
Every error returns an HTTP code and an { error: { code, message } } object. 300 calls per minute per key.
- 401
- Missing, invalid or revoked key.
- 404
- Contact, conversation, template or message not found in your workspace.
- 409
- Action not possible right now: 24-hour window closed (use a template), unsubscribed contact, slot already taken…
- 429
- Too many calls: try again a minute later.
Without writing code
- AI assistant toolsThe assistant calls your API itself to read a price, stock or status, and prepares actions your team approves.
- Google SheetsOne row per contact, order or appointment in your sheet, with a ready-made script to paste.
- Stores and carriersShopify, WooCommerce, YouCan, Sendit, Olivraison, Ozon: webhook connection, no development.

Ready to connect WhatsApp to your tools?
Create your account, test the API with the simulator, then connect your number.
