Sending Webhook Responses¶
Webhooks are HTTP endpoints — callers expect a body, not silence. Use the res instance to control exactly what goes back.
Quick start¶
The response is sent immediately and command execution stops. Treat every res.*() send call like a return.
Default behavior¶
If you do not call res, the platform returns:
with HTTP 200. Fine for fire-and-forget triggers. Bad for API integrations that parse the response body — use explicit res.json() so callers get predictable output.
Common patterns¶
JSON API¶
HTML page¶
Redirect browser¶
Error to caller¶
Full res reference¶
| Topic | Page |
|---|---|
| Overview & availability | res Overview |
set(), status() | Headers & Status |
json(), text(), xml() | JSON, Text & XML |
html(), EJS | HTML & EJS |
redirect() | Redirects |
render() | res.render() |
| Defaults, HTML protection | Defaults & Protection |
Webapp responses¶
The same res API applies to webapp commands. Public web pages do not use res — see Public Web.