Webhooks allow your application to receive real-time updates about your posts and accounts without the need to constantly poll the API.
Here is a breakdown of how to configure your webhook integrations and handle events efficiently.
Creating a Webhook
Currently, Webhooks can only be created and managed programmatically through the API. There is no UI for creating webhooks in the dashboard at this time.
How it works
You make a POST request to the /v1/webhooks endpoint with your public URL and the specific event_types you wish to subscribe to.
Note: You can not create two webhooks with the same URL
The Events
You can subscribe to the following events:
Post Events:
social.post.created,social.post.updated,social.post.deleted,social.post.result.createdAccount Events:
social.account.created,social.account.updated
Handling Requests & Timeouts
To ensure the reliability of our delivery system, your server must acknowledge receipts quickly.
The Constraint
We expect a success response (status code 2XX) within 1 second of sending the webhook.
If your server takes longer than 1 second to respond, we consider the request failed and will schedule a retry.
Best Practice
If your application needs to perform long-running tasks upon receiving a webhook (like database writes or sending emails), you should handle these asynchronously. Return a 200 OK immediately to acknowledge receipt, then process the data in the background.
Idempotency & Retries
Because webhooks are distributed systems, it is possible for your server to receive the same event multiple times.
How it works
If a delivery fails (or times out), we utilize an exponential backoff strategy, retrying the request approximately 8 times over the course of 24 hours.
The Requirement
Your server logic should be idempotent. This means your code should be able to handle receiving the same unique event ID multiple times without creating duplicate records or unintended side effects.
Security
To verify that the data hitting your server is genuinely from Post for Me, we include a security header in every request.
How it works
When you create a webhook, the API returns a unique secret. Every payload sent to your URL includes the header Post-For-Me-Webhook-Secret. Your application should always verify that this header matches your secret before processing the data.