POST /offers/message; you compose the reply from the returned offer fields and send it through whatever messaging API you already use.
This guide covers only the messaging-channel deltas; the shared flow (selection, claim via clickUrl, server-verified activation) lives in the overview, and the complete worked example is Rewarded Actions guide.
When to call
Two triggers, both gated by a max-ads-per-thread check on your side:- First message of a new conversation thread. Always eligible. Call Encore, send the offer message first, then your client’s normal automated reply as a follow-up.
- First message after a long idle gap (a re-engagement), but only if you haven’t already shown the configured max number of Encore offers in the same thread.
link.encorekit.com host. Scan the thread’s message history for outbound links to that host and compare to your per-thread cap (for example 3). Below the cap, call Encore; at the cap, skip.
Never call on mid-thread replies, and skip users who have opted out (recipient-level cooldown is a planned feature).
Sequence matters: send the offer message before your client’s reply, not after. The offer reads as a brief “while you wait” footer to the conversation rather than a postscript stapled onto the end.
Map the request fields from your webhook
The request carries aclientId, a chatId, and targeting attributes (full contract). On a Meta channel, the identifiers map to values Meta already puts in the inbound webhook payload:
If
offer comes back null, skip the promo step entirely and send only your client’s normal automated reply; that’s a normal response, never an error.
Compose and send the message
You send the offer yourself, as a normal text message, through your existing channel API. Build the text from the offer fields (title, description, perk, advertiserName). The only hard requirement: the branded short clickUrl must appear in the text so the tap attributes correctly.
A simple, effective plain-text template (field contract: POST /offers/message response):
Get 6 months free by claiming now: https://link.encorekit.com/aB3xY7q2 - Unlocked by our partner EncoreKit
clickUrl is a plain URL, so it renders and links correctly in any text channel with no interactive template or Graph API body required. If your channel supports media messages, attach offer.imageUrl as the image and put your copy in the caption; on text-only channels, omit the image.Gotchas
- Call once per inbound message. Retries are not deduplicated server-side; every call generates a fresh short link and analytics row. De-dupe inbound webhooks on your side before calling (retry guidance).
- Fail soft. Treat any non-200 as a signal to skip the promo step and send your client’s configured auto-reply on its own. The end-user experience should never degrade because of an Encore outage.
chatIdis the user key on this surface. It seeds ranking and is the userId on the click-time transaction, so keep it stable per conversation thread.
Related
POST /offers/messagereference: full request/response contract and status codes.- API Reference overview: the selection-mode decision table.
- Receive Completion Events: react server-side when a completion is verified.