Guides
Webhooks
Get told when something happens instead of polling. Register an endpoint and PostLake POSTs an event to it when a post publishes, fails, or an account connects — ideal for scheduled posts and async platforms.
Register an endpoint
Give PostLake a URL and the events you care about. You get back a WebhookEndpoint with a secret used to verify deliveries.
curl -X POST https://api.postlake.dev/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/hooks/postlake",
"events": ["post.published", "post.failed"]
}'Event types
| Event | Fires when |
|---|---|
post.published | Every target of a post has published. |
post.partial | Some targets published, some failed. |
post.failed | No target published. |
post.processing | A post moved to processing (async platforms). |
account.connected | A social account finished connecting. |
The delivery
PostLake POSTs a JSON body with the event type and the affected resource (the full Post for post.* events), so you can act without a follow-up API call.
{
"type": "post.published",
"data": { "id": "post_a1b2c3", "state": "published", "targets": [ … ] }
}Verify the signature
Each delivery is signed with your endpoint's secret (sent as a signature header). Recompute the HMAC over the raw request body and compare in constant time before trusting the payload — this proves the request really came from PostLake. Respond 2xx quickly; failed deliveries are retried.
Managing endpoints
List your endpoints with GET /v1/webhooks and remove one with DELETE /v1/webhooks/{id}. See the API reference for the exact shapes.