GuidesIntroductionQuickstart▾ WebhooksReceive webhooksVerify signaturesRetriesAPI referenceRate limitsdraftErrorsEventsMedia libraryTabs, navbar and footer
Receive webhooks
Relay sends an HTTP POST to your endpoint every time something happens in your account.
Relay waits five seconds for an answer, so answer first and do the slow work after.
Suggested by Specly from relay/api #482
If your endpoint answers 429, Relay tries again in a minute. Relay waits for the seconds in your Retry-After header, then tries again.
If your endpoint answers 429, Relay waits for the seconds in your Retry-After header, then tries again.
If your endpoint answers 429, Relay tries again in a minute.
NodePythonGo
app.post('/hooks/relay', raw, (req, res) => {
verify(req.body, req.headers['relay-signature']);
res.sendStatus(200); // answer first
queue.add(req.body); // then the slow work
});
WarningVerify against the raw body. Parsing the JSON first changes the bytes.
Text
Layout
Media
What Publish writes to docs/guides/receive-webhooks.mdx. Edit either side; they stay in step.
---title: Receive webhooks
description: Relay sends an HTTP POST to your endpoint every time something happens in your account.
---
Relay waits five seconds for an answer, so **answer first and do the slow work after**.
If your endpoint answers 429, Relay waits for the seconds in your Retry-After header, then tries again.<CodeGroup>
```js Node
app.post('/hooks/relay', raw, (req, res) => { … })
```
</CodeGroup><Warning>
Verify against the raw body. Parsing the JSON first changes the bytes.
</Warning>
Relay DocsguidesapichangelogSearch ⌘K
Guides · Webhooks
Receive webhooks
Relay sends an HTTP POST to your endpoint every time something happens in your account. It waits five seconds for an answer, so answer first and do the slow work after.
Preview, built from your unpublished edits with your theme.
From your code
relay/api #482 · mergedSend Retry-After with every 429
Specly found one sentence on this page that the change makes wrong, and drafted the fix.
Before you publishLinks resolveContrast passes!One image needs alt text
Works with the agents you and your readers already use
Claude Code
Cursor
ChatGPT
Any MCP client
How it works
You write Markdown.
In your repo, next to the code it explains. MDX when a page needs components.
Specly checks every build.
Links, contrast and alt text, with a preview for each pull request.
It ships as your docs.
Colors, fonts and background come from one theme.json.
And agents read it too.
Every page also ships as clean Markdown, listed in llms.txt, and through an MCP server on Specly Cloud.
guides/receive-webhooks.mdxdocs.relay.dev/guides/webhooksLiveCheckingBuild passed · 2.1 s
Get startedIntroductionQuickstartWebhooksReceive webhooksVerify signaturesRetries
12345678910111213
---title:Receive webhooks---Relay sends an HTTP POST to your endpointevery time something happens in your account.<Warning>Verify the raw body before you parse it.</Warning>See[Verify signatures](./signatures.md)
Guides · Webhooks
Receive webhooks
Relay sends an HTTP POST to your endpoint every time something happens in your account.
WarningVerify the raw body before you parse it.
SeeVerify signatures
How a webhook travels
docs.relay.dev/guides/webhooks.mdtext/markdown
# Receive webhooksRelay sends an HTTP POST to your endpoint every time something happens in your account.> **Warning:** Verify the raw body before you parse it.See [Verify signatures](/guides/signatures.md).# listed in /llms.txt · served over MCP
✓Contrast14.3:1 on paper✓Link resolvessignatures.md✓Alt textis setClaude CodeGET /guides/webhooks.mdCursorsearch_pages("webhooks")Any agentGET /llms.txt
One home for docs and agents
Everything a docs team needs to write and ship, and everything an agent needs to read what you shipped.
llms.txtAgent-ready by default
Every page also ships as clean Markdown, listed in llms.txt and llms-full.txt.
MCPAn MCP server for every site
Sites on Specly Cloud get a read-only MCP server that searches and reads your pages.
PR → docsKeeps up with your code Coming
When a pull request changes how your product works, Specly drafts the fix to your docs.
theme.jsonYour design, not a template
Colors, fonts and background from one file, checked for contrast on every build.
npx specly-docsIn your repo and your editor
Markdown and MDX in GitHub, a CLI for preview and CI, and an extension for VS Code and Cursor.
✓ checksPreviewed, checked, shipped
Links, contrast and alt text are checked on every build, with a preview for each pull request.
Agents read it too
More and more of your readers arrive through an AI agent. Next to the page people read, Specly publishes the version agents read best. Your coding agent can write too: it proposes changes you review before they go live.
Relay Docsguidesapichangelog
docs.relay.dev/guides/webhooks.mdtext/markdown
Guides · Webhooks
Receive webhooks
Copy page ▾
# Receive webhooks
Relay sends an HTTP POST to your endpoint every time something happens in your account.
Relay sends an HTTP POST to your endpoint every time something happens in your account.
WarningVerify the raw body before you parse it. Parsing the JSON first changes the bytes.
> **Warning:** Verify the raw body before you parse it. Parsing the JSON first changes the bytes.