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. 1

    Create a key

    In automatesend, Integrations → API: the “as_live_…” key is shown only once. Keep it server-side.

  2. 2

    Call the API

    Over HTTPS with JSON and the Authorization: Bearer header. Moroccan numbers are accepted as written (0661234567).

  3. 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 template
  • GET/messages/IDstatus of a message (sent, delivered, read, failed)
  • POST/contactsCreate or update a contact
  • GET/contacts?phone=0661234567find a contact (pagination limit, cursor)
  • GET/conversations?status=openlist conversations (filters status, needs_human, phone)
  • GET/conversations/ID/messagesmessages of a conversation, newest first
  • POST/conversations/ID/messagesreply with free text in the conversation (within 24 hours)
  • POST/conversations/ID/templatesend an approved template in the conversation
  • GET/campaignslist campaigns with their figures
  • POST/campaigns/ID/launchlaunch a scheduled campaign right away, or resume a paused one
  • GET/analytics/overview?from=…&to=…overview: messages, read rate, conversations, orders, Meta cost
  • GET · 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 customer
  • message.sentMessage sent (team, assistant, automations, API)
  • message.statusStatus of a sent message (delivered, read, failed)
  • contact.createdNew contact
  • contact.unsubscribedContact unsubscribed
  • conversation.openedConversation opened (new or reopened)
  • conversation.closedConversation closed by the team
  • conversation.handoffConversation handed to the team by the assistant
  • campaign.launchedCampaign launched
  • campaign.completedCampaign completed (with its figures)
  • order.createdOrder received
  • order.confirmedOrder confirmed by the customer
  • order.cancelledOrder cancelled by the customer
  • order.reviewedCustomer review after delivery
  • link.clickedClick on a tracked link
  • appointment.bookedAppointment booked
  • appointment.rescheduledAppointment rescheduled
  • appointment.confirmedAppointment confirmed by the customer
  • appointment.cancelledAppointment cancelled
  • form.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.