Skip to content

Webhooks

Operations related to incoming git webhooks.

Create GitHub webhook event

Request

Registers and start process GitHub repository event. For now only push and create pull request events are supported.

Security
GithubApiKey
Bodyapplication/jsonrequired
One of:
refstringrequired

The full git ref that is pushed. Example: refs/heads/main or refs/tags/v3.14.1.

beforestringrequired

The SHA of the most recent commit on ref before the push.

afterstringrequired

The SHA of the most recent commit on ref after the push.

createdbooleanrequired

Whether this push created the ref.

deletedbooleanrequired

Whether this push deleted the ref.

forcedbooleanrequired

Whether this push is a force push of the ref.

base_refstring or nullrequired
comparestringrequired

URL that shows the changes in this ref update, from the before commit to the after commit. For a newly created ref that is directly based on the default branch, this is the comparison between the head of the default branch and the after commit. Otherwise, this shows all commits until the after commit.

commitsArray of objects(Commit)required

An array of commit objects describing the pushed commits. (Pushed commits are all commits that are included in the compare between the before commit and the after commit.) The array includes a maximum of 20 commits. If necessary, you can use the Commits API to fetch additional commits. This limit is applied to timeline events only and isn't applied to webhook deliveries.

head_commitCommit (object) or nullrequired
One of:

For pushes where after is or points to a commit object, an expanded representation of that commit. For pushes where after refers to an annotated tag object, an expanded representation of the commit pointed to by the annotated tag.

repositoryobject(Repository)required

A git repository.

pusherobject(Committer)required

Metaproperties for Git author/committer information.

senderobject(User)required
installationobject(InstallationLite)

Installation.

organizationobject(Organization)
curl -i -X POST \
  https://redocly.com/_mock/docs/realm/scout/agent-api/openapi/webhooks/github \
  -H 'Content-Type: application/json' \
  -H 'x-hub-signature-256: YOUR_API_KEY_HERE' \
  -d '{
    "ref": "string",
    "before": "string",
    "after": "string",
    "created": true,
    "deleted": true,
    "forced": true,
    "base_ref": "string",
    "compare": "string",
    "commits": [
      {
        "id": "string",
        "tree_id": "string",
        "distinct": true,
        "message": "string",
        "timestamp": "2019-08-24T14:15:22Z",
        "url": "http://example.com",
        "author": {
          "name": "string",
          "email": "user@example.com",
          "date": "2019-08-24T14:15:22Z",
          "username": "string"
        },
        "committer": {
          "name": "string",
          "email": "user@example.com",
          "date": "2019-08-24T14:15:22Z",
          "username": "string"
        },
        "added": [
          "string"
        ],
        "modified": [
          "string"
        ],
        "removed": [
          "string"
        ]
      }
    ],
    "head_commit": {
      "id": "string",
      "tree_id": "string",
      "distinct": true,
      "message": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "url": "http://example.com",
      "author": {
        "name": "string",
        "email": "user@example.com",
        "date": "2019-08-24T14:15:22Z",
        "username": "string"
      },
      "committer": {
        "name": "string",
        "email": "user@example.com",
        "date": "2019-08-24T14:15:22Z",
        "username": "string"
      },
      "added": [
        "string"
      ],
      "modified": [
        "string"
      ],
      "removed": [
        "string"
      ]
    },
    "repository": {
      "id": 0,
      "node_id": "string",
      "name": "string",
      "full_name": "string",
      "private": true,
      "owner": {
        "login": "string",
        "id": 0,
        "node_id": "string",
        "name": "string",
        "email": "string",
        "avatar_url": "http://example.com",
        "gravatar_id": "string",
        "url": "http://example.com",
        "html_url": "http://example.com",
        "followers_url": "http://example.com",
        "following_url": "http://example.com/{endpoint}",
        "gists_url": "http://example.com/{endpoint}",
        "starred_url": "http://example.com/{endpoint}",
        "subscriptions_url": "http://example.com",
        "organizations_url": "http://example.com",
        "repos_url": "http://example.com",
        "events_url": "http://example.com/{endpoint}",
        "received_events_url": "http://example.com",
        "type": "Bot",
        "site_admin": true
      },
      "html_url": "http://example.com",
      "description": "string",
      "fork": true,
      "url": "http://example.com",
      "forks_url": "http://example.com",
      "keys_url": "http://example.com/{endpoint}",
      "collaborators_url": "http://example.com/{endpoint}",
      "teams_url": "http://example.com",
      "hooks_url": "http://example.com",
      "issue_events_url": "http://example.com/{endpoint}",
      "events_url": "http://example.com",
      "assignees_url": "http://example.com/{endpoint}",
      "branches_url": "http://example.com/{endpoint}",
      "tags_url": "http://example.com",
      "blobs_url": "http://example.com/{endpoint}",
      "git_tags_url": "http://example.com/{endpoint}",
      "git_refs_url": "http://example.com/{endpoint}",
      "trees_url": "http://example.com/{endpoint}",
      "statuses_url": "http://example.com/{endpoint}",
      "languages_url": "http://example.com",
      "stargazers_url": "http://example.com",
      "contributors_url": "http://example.com",
      "subscribers_url": "http://example.com",
      "subscription_url": "http://example.com",
      "commits_url": "http://example.com/{endpoint}",
      "git_commits_url": "http://example.com/{endpoint}",
      "comments_url": "http://example.com/{endpoint}",
      "issue_comment_url": "http://example.com/{endpoint}",
      "contents_url": "http://example.com/{endpoint}",
      "compare_url": "http://example.com/{endpoint}",
      "merges_url": "http://example.com",
      "archive_url": "http://example.com/{endpoint}",
      "downloads_url": "http://example.com",
      "issues_url": "http://example.com/{endpoint}",
      "pulls_url": "http://example.com/{endpoint}",
      "milestones_url": "http://example.com/{endpoint}",
      "notifications_url": "http://example.com/{endpoint}",
      "labels_url": "http://example.com/{endpoint}",
      "releases_url": "http://example.com/{endpoint}",
      "deployments_url": "http://example.com",
      "created_at": 0,
      "updated_at": "2019-08-24T14:15:22Z",
      "pushed_at": 0,
      "git_url": "http://example.com",
      "ssh_url": "string",
      "clone_url": "http://example.com",
      "svn_url": "http://example.com",
      "homepage": "string",
      "size": 0,
      "stargazers_count": 0,
      "watchers_count": 0,
      "language": "string",
      "has_issues": true,
      "has_projects": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": true,
      "forks_count": 0,
      "mirror_url": "http://example.com",
      "archived": false,
      "disabled": true,
      "open_issues_count": 0,
      "license": {
        "key": "string",
        "name": "string",
        "spdx_id": "string",
        "url": "http://example.com",
        "node_id": "string"
      },
      "forks": 0,
      "open_issues": 0,
      "watchers": 0,
      "stargazers": 0,
      "default_branch": "string",
      "allow_squash_merge": true,
      "allow_merge_commit": true,
      "allow_rebase_merge": true,
      "allow_auto_merge": false,
      "allow_forking": true,
      "allow_update_branch": true,
      "use_squash_pr_title_as_default": true,
      "is_template": true,
      "web_commit_signoff_required": true,
      "topics": [
        "string"
      ],
      "visibility": "public",
      "delete_branch_on_merge": false,
      "master_branch": "string",
      "permissions": {
        "pull": true,
        "push": true,
        "admin": true,
        "maintain": true,
        "triage": true
      },
      "public": true,
      "organization": "string"
    },
    "pusher": {
      "name": "string",
      "email": "user@example.com",
      "date": "2019-08-24T14:15:22Z",
      "username": "string"
    },
    "sender": {
      "login": "string",
      "id": 0,
      "node_id": "string",
      "name": "string",
      "email": "string",
      "avatar_url": "http://example.com",
      "gravatar_id": "string",
      "url": "http://example.com",
      "html_url": "http://example.com",
      "followers_url": "http://example.com",
      "following_url": "http://example.com/{endpoint}",
      "gists_url": "http://example.com/{endpoint}",
      "starred_url": "http://example.com/{endpoint}",
      "subscriptions_url": "http://example.com",
      "organizations_url": "http://example.com",
      "repos_url": "http://example.com",
      "events_url": "http://example.com/{endpoint}",
      "received_events_url": "http://example.com",
      "type": "Bot",
      "site_admin": true
    },
    "installation": {
      "id": 0,
      "node_id": "string"
    },
    "organization": {
      "login": "string",
      "id": 0,
      "node_id": "string",
      "url": "http://example.com",
      "html_url": "http://example.com",
      "repos_url": "http://example.com",
      "events_url": "http://example.com",
      "hooks_url": "http://example.com",
      "issues_url": "http://example.com",
      "members_url": "http://example.com/{endpoint}",
      "public_members_url": "http://example.com/{endpoint}",
      "avatar_url": "http://example.com",
      "description": "string"
    }
  }'

Responses

OK.

Bodyapplication/problem+json
messagestring

A human-readable message with more details.

Example:"Job created"
eventstring

Type of incoming webhook event.

Example:"push"
jobIdstring

Created Scout job ID.

Example:"sjob_01h4gev6h1j50ge5z3yn28ge5e"
Response
{ "message": "Job created", "event": "push", "jobId": "sjob_01h4gev6h1j50ge5z3yn28ge5e" }