How delivery works
Heymarket sends an HTTPSPOST request to your configured webhook URL. Your receiver should parse the JSON body, validate the token for the webhook configuration, persist what it needs, and return a 2xx response quickly.
If processing may take more than a short moment, acknowledge the webhook first and move the work to a queue. Make processing idempotent with type plus a stable ID inside event_data when one is present, so repeated deliveries do not create duplicate work.
Steps
1
Create an HTTPS receiver
Create a public HTTPS endpoint that accepts
POST requests with JSON bodies.webhook receiver
2
Configure the webhook URL
Add the HTTPS endpoint in the Heymarket app webhook settings. Store the webhook verification token from that configuration and compare it with the Webhook URLs are configured in the Heymarket app. The public REST API reference documents webhook payloads, but it does not provide a webhook-management endpoint.
token value in every payload.For app configuration steps, see the Heymarket Help Center article: Getting Started with Webhooks.
3
Handle the event payload
Webhook payloads include The envelope
type, id, token, and event_data.id is a UUID generated for the event, not a webhook configuration ID. Every webhook configuration that receives the same event receives the same id, so pair it with type to deduplicate deliveries.The event_data shape depends on the event type. Message events send a message object, conversation events send a conversation object, and opt-in or opt-out events send an unsubscribe-state object.Event types
Webhooktype values include:
message_sentmessage_recievedchat_reassignedchat_closedchat_openedchat_pendingchat_transferredtarget_opt_outtarget_opt_intarget_double_opt_intarget_double_opt_restrictedincoming_call
The current API spelling is
message_recieved. Match that exact value when branching on inbound-message events.Message event payload
message_sent and message_recieved events send a message object as event_data.
For the full field list, see the webhook event reference.
When you write a receiver for message events, plan for these behaviors:
- Most fields are omitted when empty. Treat a missing key as an empty or zero value rather than requiring it.
useridentifies the sending team member and is omitted on incoming messages. Use its presence to tell outbound from inbound.superis the conversation ID. The full conversation is also embedded asconversation.- Group messages set
targetswith the individual phone numbers andsenderwith the sending number. On those eventstargetis a single|-separated string. statusandraw_errorapply to outbound messages. For group messages, per-target failures arrive intarget_errors, keyed by target.hiddenmarks a message whose content is withheld, so content fields can be empty even though the message exists.
The
flagged field appears in the message schema but is not populated on webhook deliveries.Example
An inbound SMS delivers a payload like this.Security
- Keep webhook URLs private.
- Validate the
tokenvalue before processing the event. - Do not expose webhook URLs in client-side code or public repositories.
- Use separate webhook URLs for separate environments.
- Log event type, webhook ID, and processing outcome for troubleshooting.
Related pages
Webhooks concept
Understand where webhooks fit with REST API calls.
Messages reference
Send follow-up messages after webhook events.
Webhook event reference
Review the generated webhook payload schema.