Webhook Payload Invalid JSON
Many webhooks send JSON in the request body. Invalid JSON (syntax errors, wrong encoding) causes parsing to fail and the webhook handler to reject or misprocess the payload.
Common causes
- Trailing commas or single quotes in the payload.
- Truncated or corrupted body in transit.
- Content-Type not application/json or charset issues.
How to fix
- Validate the raw body with a JSON validator to find syntax errors.
- Ensure the sender serializes the payload as valid JSON (double quotes, no trailing commas).
- Check Content-Type header is application/json and encoding is UTF-8.
FAQ
- How do I debug webhook payload errors?
- Log the raw request body and run it through a JSON validator; fix the generator or encoding on the sender side.
- Can webhooks use XML instead of JSON?
- Yes, but the handler must expect XML and set Content-Type accordingly. JSON is more common for APIs.
Fix it now
Try in validator (prefill this example)