To type a GitHub webhook payload, paste the event body (a push, pull_request, or issues event) into PayloadIQ and it generates TypeScript types and a Zod schema — in your browser, nothing uploaded. Webhook handlers are a classic place for runtime validation: the payload comes from the network, so a Zod schema at the entry point catches malformed or spoofed bodies before your code touches them.
Example push event
A trimmed push webhook payload:
{
"ref": "refs/heads/main",
"before": "9049f1265b7d61be4a8904a9a27120d2064dab3b",
"after": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c",
"repository": {
"id": 186853002,
"name": "octo-repo",
"full_name": "octocat/octo-repo",
"private": false,
"default_branch": "main"
},
"pusher": { "name": "octocat", "email": "octocat@example.com" },
"commits": [
{
"id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c",
"message": "Fix all the bugs",
"timestamp": "2024-09-24T18:30:00Z",
"author": { "name": "Mona Octocat", "email": "mona@example.com" },
"added": ["src/new.ts"],
"modified": ["README.md"],
"removed": []
}
],
"head_commit": null
}What you get back
PayloadIQ infers a PushEvent interface with a typed repository, pusher, and a commits array (each with added / modified / removed string arrays), plus a Zod schema to validate the body inside your webhook route. Note fields like head_commit that can be null — the inferred type marks them optional so you handle them.
Local and safe
Webhook payloads can carry private repository and author details. Because everything runs in your browser, you can paste a real delivery from the GitHub UI without it leaving your machine.