POST request with a JSON payload as soon as the event occurs. This makes webhooks the right tool for real-time workflows like auto-responses, CRM syncs, and escalation routing.
How webhooks work
When an event occurs in Heymarket, the platform sends an HTTPPOST request to the URL you configure. The request body is a JSON object containing event details, using the same message and conversation structure returned by the REST API. Your server must respond with HTTP 200 to acknowledge receipt. If Heymarket does not receive a 200, it will retry the delivery.
Setup steps
Set up a public HTTPS endpoint
Your webhook receiver must be accessible over the public internet via HTTPS. Create an endpoint on your server that accepts
POST requests and reads the JSON body. During local development you can use a tunneling tool like ngrok to expose a local port.example receiver (Python/Flask)
Configure the webhook URL in Heymarket
Log in to Heymarket and navigate to Settings. Enter your public HTTPS endpoint URL in the webhook configuration field. Save the setting to activate delivery.
For full configuration instructions, see the Heymarket Help Center: Getting Started with Webhooks.
Receive POST requests with event payloads
Once configured, Heymarket sends a
POST request to your endpoint each time a subscribed event occurs. The payload is a JSON object with event details. Log and inspect the first few events to understand the structure before building your processing logic.Example inbound message payload:Respond with HTTP 200
Return an HTTP
200 status as quickly as possible — before doing any heavy processing. If your handler takes too long or returns a non-200 status, Heymarket will retry the delivery. Offload time-consuming work to a background queue after acknowledging the request.acknowledgement
Payload structure
Webhook payloads follow the same object structure as REST API responses. Each payload includes:event— the event type (e.g.,message_received,message_sent,chat_updated)message— the message object withid,text,direction,date, and sender/recipient detailschat— the conversation object withid,inbox_id, and other conversation metadata
Security
Heymarket recommends keeping your webhook URL private. Do not publish it in client-side code or public repositories. If your endpoint is compromised, update the URL in Heymarket settings immediately. Consider validating that incoming requests originate from Heymarket by checking the source IP or adding a secret token to your endpoint URL path that only your server and Heymarket know.For full configuration steps and additional security guidance, see the Heymarket Help Center article: Getting Started with Webhooks.
Common use cases
- Route inbound SMS replies — parse the message text and forward to the correct team or system based on keywords or contact data.
- Sync CRM records — update a contact record in your CRM whenever a message is sent or received, keeping communication history in one place.
- Trigger auto-responses — detect specific keywords in inbound messages and immediately send a reply via
POST /v1/message/send. - Escalate conversations — monitor for unanswered messages and alert a supervisor or open a support ticket after a defined time threshold.