{"id":13433012,"url":"https://github.com/octokit/webhooks","last_synced_at":"2025-06-16T20:09:25.832Z","repository":{"id":38428705,"uuid":"161374304","full_name":"octokit/webhooks","owner":"octokit","description":"machine-readable, always up-to-date GitHub Webhooks specifications","archived":false,"fork":false,"pushed_at":"2025-05-27T19:43:37.000Z","size":11994,"stargazers_count":243,"open_issues_count":15,"forks_count":41,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-09T01:06:07.465Z","etag":null,"topics":["generated","hacktoberfest","octokit-js","schema","specifications","webhooks"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octokit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-11T18:08:37.000Z","updated_at":"2025-05-20T06:15:38.000Z","dependencies_parsed_at":"2023-11-21T14:31:41.306Z","dependency_job_id":"665d7b43-9d5a-4e7f-b338-b63dfc85d6e5","html_url":"https://github.com/octokit/webhooks","commit_stats":{"total_commits":750,"total_committers":32,"mean_commits":23.4375,"dds":0.8200000000000001,"last_synced_commit":"1eabcdf8b55487139ee52fae69020b69e692cc00"},"previous_names":[],"tags_count":273,"template":false,"template_full_name":null,"purl":"pkg:github/octokit/webhooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Fwebhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Fwebhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Fwebhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Fwebhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octokit","download_url":"https://codeload.github.com/octokit/webhooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Fwebhooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260230731,"owners_count":22978178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generated","hacktoberfest","octokit-js","schema","specifications","webhooks"],"created_at":"2024-07-31T02:01:19.769Z","updated_at":"2025-06-16T20:09:25.814Z","avatar_url":"https://github.com/octokit.png","language":"TypeScript","readme":"# Octokit Webhooks\n\n\u003e machine-readable, always up-to-date GitHub Webhooks specifications\n\n![Update status](https://github.com/octokit/webhooks/workflows/Update/badge.svg)\n\n## Download\n\nDownload the latest specification at\n[octokit.github.io/webhooks/payload-examples/api.github.com/index.json](https://octokit.github.io/webhooks/payload-examples/api.github.com/index.json)\n\n## Example\n\nExample webhook definition\n\n```json\n{\n  \"name\": \"issues\",\n  \"actions\": [\n    \"opened\",\n    \"edited\",\n    \"deleted\",\n    \"transferred\",\n    \"closed\",\n    \"reopened\",\n    \"assigned\",\n    \"unassigned\",\n    \"labeled\",\n    \"unlabeled\",\n    \"milestoned\",\n    \"demilestoned\"\n  ],\n  \"examples\": [\n    {\n      \"action\": \"edited\",\n      \"issue\": {\n        \"url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues/2\",\n        \"repository_url\": \"https://api.github.com/repos/Codertocat/Hello-World\",\n        \"labels_url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues/2/labels{/name}\",\n        \"comments_url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments\",\n        \"events_url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues/2/events\",\n        \"html_url\": \"https://github.com/Codertocat/Hello-World/issues/2\",\n        \"id\": 327883527,\n        \"node_id\": \"MDU6SXNzdWUzMjc4ODM1Mjc=\",\n        \"number\": 2,\n        \"title\": \"Spelling error in the README file\",\n        \"user\": {\n          \"login\": \"Codertocat\",\n          \"id\": 21031067,\n          \"node_id\": \"MDQ6VXNlcjIxMDMxMDY3\",\n          \"avatar_url\": \"https://avatars1.githubusercontent.com/u/21031067?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/Codertocat\",\n          \"html_url\": \"https://github.com/Codertocat\",\n          \"followers_url\": \"https://api.github.com/users/Codertocat/followers\",\n          \"following_url\": \"https://api.github.com/users/Codertocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/Codertocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/Codertocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/Codertocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/Codertocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/Codertocat/repos\",\n          \"events_url\": \"https://api.github.com/users/Codertocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/Codertocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"labels\": [\n          {\n            \"id\": 949737505,\n            \"node_id\": \"MDU6TGFiZWw5NDk3Mzc1MDU=\",\n            \"url\": \"https://api.github.com/repos/Codertocat/Hello-World/labels/bug\",\n            \"name\": \"bug\",\n            \"color\": \"d73a4a\",\n            \"default\": true\n          }\n        ],\n        \"state\": \"open\",\n        \"locked\": false,\n        \"assignee\": null,\n        \"assignees\": [\n          {\n            \"login\": \"Codertocat\",\n            \"id\": 21031067,\n            \"node_id\": \"MDQ6VXNlcjIxMDMxMDY3\",\n            \"avatar_url\": \"https://avatars1.githubusercontent.com/u/21031067?v=4\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/Codertocat\",\n            \"html_url\": \"https://github.com/Codertocat\",\n            \"followers_url\": \"https://api.github.com/users/Codertocat/followers\",\n            \"following_url\": \"https://api.github.com/users/Codertocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/Codertocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/Codertocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/Codertocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/Codertocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/Codertocat/repos\",\n            \"events_url\": \"https://api.github.com/users/Codertocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/Codertocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        ],\n        \"milestone\": null,\n        \"comments\": 0,\n        \"created_at\": \"2018-05-30T20:18:32Z\",\n        \"updated_at\": \"2018-05-30T20:18:32Z\",\n        \"closed_at\": null,\n        \"author_association\": \"OWNER\",\n        \"body\": \"It looks like you accidently spelled 'commit' with two 't's.\"\n      },\n      \"changes\": {},\n      \"repository\": {\n        \"id\": 135493233,\n        \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=\",\n        \"name\": \"Hello-World\",\n        \"full_name\": \"Codertocat/Hello-World\",\n        \"owner\": {\n          \"login\": \"Codertocat\",\n          \"id\": 21031067,\n          \"node_id\": \"MDQ6VXNlcjIxMDMxMDY3\",\n          \"avatar_url\": \"https://avatars1.githubusercontent.com/u/21031067?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/Codertocat\",\n          \"html_url\": \"https://github.com/Codertocat\",\n          \"followers_url\": \"https://api.github.com/users/Codertocat/followers\",\n          \"following_url\": \"https://api.github.com/users/Codertocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/Codertocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/Codertocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/Codertocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/Codertocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/Codertocat/repos\",\n          \"events_url\": \"https://api.github.com/users/Codertocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/Codertocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"private\": false,\n        \"html_url\": \"https://github.com/Codertocat/Hello-World\",\n        \"description\": null,\n        \"fork\": false,\n        \"url\": \"https://api.github.com/repos/Codertocat/Hello-World\",\n        \"forks_url\": \"https://api.github.com/repos/Codertocat/Hello-World/forks\",\n        \"keys_url\": \"https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}\",\n        \"collaborators_url\": \"https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}\",\n        \"teams_url\": \"https://api.github.com/repos/Codertocat/Hello-World/teams\",\n        \"hooks_url\": \"https://api.github.com/repos/Codertocat/Hello-World/hooks\",\n        \"issue_events_url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}\",\n        \"events_url\": \"https://api.github.com/repos/Codertocat/Hello-World/events\",\n        \"assignees_url\": \"https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}\",\n        \"branches_url\": \"https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}\",\n        \"tags_url\": \"https://api.github.com/repos/Codertocat/Hello-World/tags\",\n        \"blobs_url\": \"https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}\",\n        \"git_tags_url\": \"https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}\",\n        \"git_refs_url\": \"https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}\",\n        \"trees_url\": \"https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}\",\n        \"statuses_url\": \"https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}\",\n        \"languages_url\": \"https://api.github.com/repos/Codertocat/Hello-World/languages\",\n        \"stargazers_url\": \"https://api.github.com/repos/Codertocat/Hello-World/stargazers\",\n        \"contributors_url\": \"https://api.github.com/repos/Codertocat/Hello-World/contributors\",\n        \"subscribers_url\": \"https://api.github.com/repos/Codertocat/Hello-World/subscribers\",\n        \"subscription_url\": \"https://api.github.com/repos/Codertocat/Hello-World/subscription\",\n        \"commits_url\": \"https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}\",\n        \"git_commits_url\": \"https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}\",\n        \"comments_url\": \"https://api.github.com/repos/Codertocat/Hello-World/comments{/number}\",\n        \"issue_comment_url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}\",\n        \"contents_url\": \"https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}\",\n        \"compare_url\": \"https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}\",\n        \"merges_url\": \"https://api.github.com/repos/Codertocat/Hello-World/merges\",\n        \"archive_url\": \"https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}\",\n        \"downloads_url\": \"https://api.github.com/repos/Codertocat/Hello-World/downloads\",\n        \"issues_url\": \"https://api.github.com/repos/Codertocat/Hello-World/issues{/number}\",\n        \"pulls_url\": \"https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}\",\n        \"milestones_url\": \"https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}\",\n        \"notifications_url\": \"https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}\",\n        \"labels_url\": \"https://api.github.com/repos/Codertocat/Hello-World/labels{/name}\",\n        \"releases_url\": \"https://api.github.com/repos/Codertocat/Hello-World/releases{/id}\",\n        \"deployments_url\": \"https://api.github.com/repos/Codertocat/Hello-World/deployments\",\n        \"created_at\": \"2018-05-30T20:18:04Z\",\n        \"updated_at\": \"2018-05-30T20:18:10Z\",\n        \"pushed_at\": \"2018-05-30T20:18:30Z\",\n        \"git_url\": \"git://github.com/Codertocat/Hello-World.git\",\n        \"ssh_url\": \"git@github.com:Codertocat/Hello-World.git\",\n        \"clone_url\": \"https://github.com/Codertocat/Hello-World.git\",\n        \"svn_url\": \"https://github.com/Codertocat/Hello-World\",\n        \"homepage\": null,\n        \"size\": 0,\n        \"stargazers_count\": 0,\n        \"watchers_count\": 0,\n        \"language\": null,\n        \"has_issues\": true,\n        \"has_projects\": true,\n        \"has_downloads\": true,\n        \"has_wiki\": true,\n        \"has_pages\": true,\n        \"forks_count\": 0,\n        \"mirror_url\": null,\n        \"archived\": false,\n        \"open_issues_count\": 2,\n        \"license\": null,\n        \"forks\": 0,\n        \"open_issues\": 2,\n        \"watchers\": 0,\n        \"default_branch\": \"master\"\n      },\n      \"sender\": {\n        \"login\": \"Codertocat\",\n        \"id\": 21031067,\n        \"node_id\": \"MDQ6VXNlcjIxMDMxMDY3\",\n        \"avatar_url\": \"https://avatars1.githubusercontent.com/u/21031067?v=4\",\n        \"gravatar_id\": \"\",\n        \"url\": \"https://api.github.com/users/Codertocat\",\n        \"html_url\": \"https://github.com/Codertocat\",\n        \"followers_url\": \"https://api.github.com/users/Codertocat/followers\",\n        \"following_url\": \"https://api.github.com/users/Codertocat/following{/other_user}\",\n        \"gists_url\": \"https://api.github.com/users/Codertocat/gists{/gist_id}\",\n        \"starred_url\": \"https://api.github.com/users/Codertocat/starred{/owner}{/repo}\",\n        \"subscriptions_url\": \"https://api.github.com/users/Codertocat/subscriptions\",\n        \"organizations_url\": \"https://api.github.com/users/Codertocat/orgs\",\n        \"repos_url\": \"https://api.github.com/users/Codertocat/repos\",\n        \"events_url\": \"https://api.github.com/users/Codertocat/events{/privacy}\",\n        \"received_events_url\": \"https://api.github.com/users/Codertocat/received_events\",\n        \"type\": \"User\",\n        \"site_admin\": false\n      }\n    }\n  ]\n}\n```\n\n## Download webhook definitions and webhook payloads schema\n\nYou can download the latest `index.json` and `schema.json` files from\n[unpkg](https://unpkg.com/)\n\n- [`index.json`](https://unpkg.com/@octokit/webhooks-examples/api.github.com/index.json)\n- [`schema.json`](https://unpkg.com/@octokit/webhooks-schemas/schema.json)\n\n## Usage as Node module\n\nTo get an array of all webhook definition objects, require the `@octokit/webhooks-examples` package.\n\n```js\n// Use Node.js require:\nconst WEBHOOKS = require(\"@octokit/webhooks-examples/api.github.com/index.json\");\n\n// Or ESM/TypeScript import:\nimport WEBHOOKS from \"@octokit/webhooks-examples/api.github.com/index.json\";\n```\n\nTo get the JSON schema for webhook payloads, require the `@octokit/webhooks-schemas` package.\n\n```js\n// Use Node.js require:\nconst SCHEMA = require(\"@octokit/webhooks-schemas\");\n\n// Or ESM/TypeScript import:\nimport SCHEMA from \"@octokit/webhooks-schemas\";\n```\n\n### Usage with `ajv` in `strict` mode\n\nWhen running in `strict` mode, `ajv` will throw an \"unknown keyword\" error if it\nencounters any keywords that have not been defined.\n\nThis schema currently uses custom keywords provided by `ajv-formats`, along with\nthe custom keyword `tsAdditionalProperties`.\n\nHere is an example of how you can set this up:\n\n```ts\nimport type { WebhookEvent } from \"@octokit/webhooks-types\";\nimport * as githubWebhookSchema from \"@octokit/webhooks-schemas\";\nimport Ajv from \"ajv\";\nimport addFormats from \"ajv-formats\";\n\nconst ajv = new Ajv({ strict: true });\n\naddFormats(ajv);\najv.addKeyword(\"tsAdditionalProperties\");\n\nconst validate = ajv.compile\u003cWebhookEvent\u003e(githubWebhookSchema);\n```\n\n## Importing types\n\nThis package ships with types for the webhook events generated from the\nrespective json schemas, which you can use like so:\n\n```typescript\nimport { WebhookEvent, IssuesOpenedEvent } from \"@octokit/webhooks-types\";\n\nconst handleWebhookEvent = (event: WebhookEvent) =\u003e {\n  if (\"action\" in event \u0026\u0026 event.action === \"completed\") {\n    console.log(`${event.sender.login} completed something!`);\n  }\n};\n\nconst handleIssuesOpenedEvent = (event: IssuesOpenedEvent) =\u003e {\n  console.log(\n    `${event.sender.login} opened \"${event.issue.title}\" on ${event.repository.full_name}`,\n  );\n};\n```\n\n**⚠️ Caution ⚠️**: Webhooks Types are expected to be used with the [`strictNullChecks` option](https://www.typescriptlang.org/tsconfig#strictNullChecks) enabled in your `tsconfig`. If you don't have this option enabled, there's the possibility that you get `never` as the inferred type in some use cases. See [#395](https://github.com/octokit/webhooks/issues/395) for details.\n\n## How it works\n\nThis package updates itself using a daily cronjob running on GitHub Actions. The\n[`index.json`](index.json) file is generated by\n[`bin/octokit-webhooks.mts`](bin/octokit-webhooks.mts). Run\n`npm run octokit-webhooks -- --usage` for instructions. After the update is\ncomplete, run `npm run build:webhooks` and `npm run build:schema` to update\n`index.json` and `schema.json` files.\n\nThe update script is scraping\n[GitHub’s Webhooks Event Types \u0026 Payloads](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads)\ndocumentation page and extracts the meta information using\n[cheerio](https://www.npmjs.com/package/cheerio).\n\nFor simpler local testing and tracking of changes all loaded pages are cached in\nthe [`cache/`](cache/) folder.\n\n## See also\n\n- [octokit/graphql-schema](https://github.com/octokit/graphql-schema) – GitHub’s\n  GraphQL Schema with validation\n- [octokit/openapi](https://github.com/octokit/openapi) – GitHub REST API route\n  specifications\n- [octokit/app-permissions](https://github.com/octokit/app-permissions) – GitHub\n  App permission specifications\n\n## JSON Schema conventions\n\nWhat conventions are the schemas of this repository following?\n\nThis section offers the origin of these conventions and the reasoning behind them.\n\n### `\"email\"` for `committer.schema.json` treated as a regular `string`\n\nThe JSON schema for a committer (`committer.schema.json`) has a property `\"email\"`, which [originally was using](https://github.com/octokit/webhooks/blob/f2f7ffb6ed4179fe22b1b82b670d536a833d83f6/payload-schemas/api.github.com/common/committer.schema.json#L11) the default `email` format offered by [`ajv-format`](https://github.com/ajv-validator/ajv-formats/blob/4dd65447575b35d0187c6b125383366969e6267e/src/formats.ts#L65).\n\nWhat we noticed is [the Regular Expression used by ajv-format for `emails`](https://github.com/ajv-validator/ajv-formats/blob/4dd65447575b35d0187c6b125383366969e6267e/src/formats.ts#L65) is not accepting emails containing `[` or `]` characters (i.e. `41898282+github-actions`**[**`bot`**]**`@users.noreply.github.com`).\n\nAfter [considering the option](https://github.com/octokit/webhooks/pull/677) of applying our pattern by extending [`ajv-format` Regular Expression for emails](https://github.com/ajv-validator/ajv-formats/blob/4dd65447575b35d0187c6b125383366969e6267e/src/formats.ts#L65), we considered not to do that because:\n\n- It is an excellent way to cause more trouble (the size of this Regular Expression alone is enormous even before you think about all the sub-patterns).\n- The moment we decide to use our Regular Expression, we are committing to maintaining it, so if someone else comes along and presents another email that is considered invalid by this pattern but works with git, we will need to safely modify the pattern again to cover that in addition to what we currently consider valid.\n- If we want to be accurate, we should follow a spec to decide what is valid and what is not. [Since GitHub is not following a spec for emails (and it will not change any time soon)](https://github.com/octokit/webhooks/issues/453#issuecomment-1189113327), to be validating emails with our RegEx would not be correct either.\n\nYou can read more details and the discussion behind in this resources:\n\n- https://github.com/octokit/webhooks/issues/453\n- https://github.com/octokit/webhooks/pull/677\n- https://github.com/octokit/webhooks/pull/678\n\n## LICENSE\n\n[MIT](LICENSE.md)\n","funding_links":[],"categories":["TypeScript","hacktoberfest"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctokit%2Fwebhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctokit%2Fwebhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctokit%2Fwebhooks/lists"}