Back

Docs

API Reference

Endpoint

ANY /api/webhook/{path?}

Accepts any HTTP method (GET, POST, PUT, PATCH, DELETE, etc.) on any sub-path. Everything about the incoming request is captured and stored in the database.

What gets stored

Field Description
method HTTP method (GET, POST, PUT, etc.)
url Full request URL including query string
path The captured sub-path after /api/webhook/
query_parameters Parsed query string as JSON
headers All request headers as JSON
content_type Content-Type header value
raw_body Raw request body as-is
parsed_body Decoded JSON body (when content type is JSON)
source_ip Sender's IP address
request_duration_ms Processing time in milliseconds

Response behavior

By default, the endpoint returns a plain text 200 OK response.

To simulate a failure (useful for testing retry logic), pass fail=true as a query parameter or send the X-Fail: true header. The endpoint will then return a 500 Internal Server Error.

The request is always stored, regardless of the response status.

Examples

Basic POST with JSON body

curl -X POST https://webhook-catcher.test.coddin.app/api/webhook \
  -H "Content-Type: application/json" \
  -d '{"event": "payment.completed"}'

With a sub-path

curl -X POST https://webhook-catcher.test.coddin.app/api/webhook/stripe/events \
  -H "Content-Type: application/json" \
  -d '{"type": "invoice.paid"}'

With query parameters

curl "https://webhook-catcher.test.coddin.app/api/webhook?source=github&ref=main"

Simulate a 500 failure (query param)

curl -X POST "https://webhook-catcher.test.coddin.app/api/webhook?fail=true" \
  -H "Content-Type: application/json" \
  -d '{"test": true}'

Simulate a 500 failure (header)

curl -X POST https://webhook-catcher.test.coddin.app/api/webhook \
  -H "X-Fail: true" \
  -H "Content-Type: application/json" \
  -d '{"test": true}'