Skip to main content
A webhook tells your server (or your agent) what happened to a post, without polling GET /api/v1/posts/{post_id}. MagicPost sends a signed POST to your URL when one of your posts:
  • is published on LinkedIn: post.published
  • fails to publish: post.failed, with the LinkedIn error
Webhooks cover the posts you author. Posts that an organization admin schedules for another member are sent to that member’s webhooks, not the admin’s.
No code needed: you can also add, test and reactivate webhooks in the app, under Settings › Webhooks (paste the URL from Make, Zapier or n8n). Webhooks belong to your account, not to an API key.
All endpoints below require a Personal Access Token (Authorization: Bearer mp_…).

POST /api/v1/webhooks

Create a webhook. The signing secret is returned exactly once. Body
  • url (required): an https:// URL on a public host
  • events (optional): defaults to both events
Response (HTTP 201)
Store secret right away: it is never shown again. If you lose it, delete the webhook and create a new one. Constraints:
  • At most 5 webhooks per account (endpoint_limit_reached)
  • invalid_url: not HTTPS, or the host is not public
  • invalid_events: an event type that doesn’t exist

GET /api/v1/webhooks

List your webhooks, with each one’s latest delivery (last_delivery) and its counts for the last 7 days (last_7_days). Never returns the full URL nor the secret.

PATCH /api/v1/webhooks/

Change the events of a webhook ({"events": ["post.failed"]}). The URL and the signing secret stay the same.

DELETE /api/v1/webhooks/

Delete a webhook. Returns 404 webhook_not_found if the id isn’t one of yours.

POST /api/v1/webhooks//test

Send a signed webhook.test event to the URL right away and get the result:
excerpt is the start of your server’s response body; error explains a network or TLS failure, a timeout or a refused URL. At most 10 tests per hour (test_limit_reached, HTTP 429). Tests are not retried and don’t count toward deactivation.

POST /api/v1/webhooks//reactivate

Reactivate a webhook that was deactivated after 10 abandoned deliveries in a row. It keeps the same URL and signing secret, and its failure counter starts again from zero. No effect on an active webhook.

GET /api/v1/webhooks//deliveries

The 30 most recent deliveries of a webhook (kept 30 days), newest first: event, post (post_id and the first line of the post as post_title), status (pending, retrying, delivered, abandoned, skipped), number of attempts, the last status_code your URL returned and, while retrying or once abandoned, the last response excerpt or network error.

What you receive

  • publication has exactly the same shape as in GET /api/v1/posts/{post_id}.
  • error_family is a stable code (daily_limit, media_processing, service_incident, …). It is null for post.published.
  • needs_reconnect is true when the LinkedIn account must be reconnected in MagicPost. It is null for post.published.
  • The body never contains the text of your post.
For post.published, publication.state is published, and linkedin_url and published_at are filled.

Verify the signature

MagicPost-Signature is t=<unix timestamp>,v1=<hex>, where v1 is the HMAC-SHA256 of "<t>.<raw request body>" with your secret. Always compute it on the raw bytes you received, before parsing the JSON, compare in constant time, and reject requests whose timestamp is more than 5 minutes old.

Retries and deactivation

  • Answer with a 2xx within 10 seconds. Anything else (3xx included: redirects are not followed) counts as a failure.
  • A failed delivery is retried after 1 min, 5 min, 30 min, 2 h and 6 h, then abandoned.
  • Delivery is at least once: if a delivery attempt is interrupted on our side, it is retried, so the same event can arrive twice.
  • After 10 abandoned deliveries in a row, the webhook is deactivated (active: false) and we email you. Fix your endpoint, then reactivate it (POST /api/v1/webhooks/{id}/reactivate, or Settings › Webhooks in the app): same URL, same secret.

If an agent republishes on its own

Deduplicate on MagicPost-Event-Id. The same event can reach you twice (for example when your server answered after the timeout). Store the ids you already handled.
Don’t retry a daily_limit failure in a loop. It means the LinkedIn profile reached its posts-per-24-hours limit. Pick a later slot instead (the retry_at field of the scheduling error tells you when).
For needs_reconnect: true, republishing won’t help until the account is reconnected to LinkedIn in MagicPost.