Skip to content

Webhooks endpoint ​

Missive::Postmark::WebhooksController receives Postmark webhooks. See the guide to configure them in Postmark.

Route ​

POST <engine mount path>/postmark/webhooks

e.g. POST /missive/postmark/webhooks with mount Missive::Engine => "/missive". CSRF protection is skipped for this endpoint.

Authentication ​

Every request must have an X-Postmark-Secret header equal to Rails.application.credentials.postmark.webhooks_secret. Otherwise, the endpoint responds 401 Unauthorized.

Supported payloads ​

RecordTypeMatching fieldsEffect
DeliveryDeliveredAtsets delivered_at on the dispatch
OpenReceivedAtsets opened_at on the dispatch
SubscriptionChangeSuppressSending: true, SuppressionReasonsuppress! the subscriber, and the dispatch and subscription if found
SubscriptionChangeSuppressSending: falseunsuppress! the subscriber, and the dispatch and subscription if found

Records are matched as follows:

For Delivery and Open, the subscriber and the dispatch must exist, and the dispatch must belong to that subscriber. For SubscriptionChange, only the subscriber is required.

Responses ​

StatusBodyWhen
200 OKpayload processed
400 Bad RequestDispatch subscriber … does not match payload recipient …the dispatch belongs to another subscriber
401 UnauthorizedCannot verify webhookmissing or wrong secret
404 Not FoundMissive::Subscriber not found / Missive::Dispatch not foundno matching record
422 Unprocessable EntityWebhook payload not supportedunsupported RecordType or fields

Released under the MIT License.