REST API and webhooks

Send messages, manage contacts, start campaigns and flows from your own code, and receive signed events when things happen. The API is included on plans with REST API access.

How do I authenticate?

Create a token in the app under Developer, then send it as a bearer token. Requests and responses are JSON. Errors return success: false with a message and an HTTP 4xx status. Each token is limited to 120 requests per minute.

Phone numbers use digits with the country code, for example 919876543210.

curl -X POST "https://reach.spritegenix.com/api/v1/messages/template" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to":"919876543210",
       "template_name":"order_update",
       "language":"en_US",
       "params":["Rahul","#1023"]}'

Endpoints

Base URL https://reach.spritegenix.com/api/v1. Full request and response examples are in the in-app API reference.

MethodPathWhat it does
GET/meWorkspace, plan and usage
GET/wa-accountsConnected WhatsApp numbers
POST/messagesSend a session message: text, media, buttons, list, call to action or location (needs an open 24 hour window on Cloud API numbers)
POST/messages/templateSend an approved WhatsApp template, any time
GET/messages/{id}Delivery status of a message: sent, delivered, read or failed
GET/contactsList contacts, with search, tag and page filters
POST/contactsCreate or update a contact, matched by phone
GET/contacts/{id}Get one contact
PUT/contacts/{id}Update a contact
DELETE/contacts/{id}Delete a contact
GET/listsContact lists with member counts
GET/templatesTemplates with the variables each one needs
POST/templatesCreate a text template and submit it to Meta
GET/conversationsInbox conversations
GET/conversations/{id}/messagesMessages in a conversation
GET/campaignsCampaigns
POST/campaignsStart a WhatsApp template campaign
GET/campaigns/{id}Campaign progress and stats
POST/email/sendSend a transactional email through your SMTP sender
POST/flows/{id}/triggerStart a chatbot flow for a phone number
POST/forms/{id}/sendSend a published WhatsApp Form

Which webhook events can I receive?

Add a webhook URL in the app and choose events. Each delivery is a POST with a JSON body and an X-SGReach-Signature header: sha256= followed by the HMAC SHA-256 of the body with your webhook secret. Failed deliveries are retried.

  • message.received: Incoming WhatsApp message
  • message.sent: Outgoing message sent
  • message.status: Delivery / read / failed status
  • contact.created: New contact created
  • campaign.completed: Campaign finished
  • form.submitted: WhatsApp form submitted
  • flow.completed: Flow finished for a contact
  • call.completed: AI call finished
  • email.event: Email open / click / bounce / unsubscribe
  • conversation.assigned: Conversation assigned to agent

Can my website enroll people in a sequence?

Yes. Every drip sequence has its own webhook URL. Post a phone number or email address, and optional fields, to enroll that person, for example when a cart is abandoned or a form is submitted.

{
  "event": "message.received",
  "timestamp": 1793034483,
  "workspace_id": 1,
  "data": {
    "from": "919876543210",
    "name": "Rahul",
    "type": "text",
    "text": "Hi",
    "conversation_id": 7
  }
}

Build on four channels with one API.

Start a free trial, create a token under Developer and send your first message in minutes.