Skip to main content

event types

The Events API can return different types of events triggered by activity on . Each event response contains shared properties, but has a unique payload object determined by its event type. The Event object common properties describes the properties shared by all events, and each event type describes the payload properties that are unique to the specific event.

The event objects returned from the Events API endpoints have the same structure.

Event API attribute nameTypeDescription
idintegerUnique identifier for the event.
typestringThe type of event. Events uses PascalCase for the name.
actorobjectThe user that triggered the event.
actor.idintegerThe unique identifier for the actor.
actor.loginstringThe username of the actor.
actor.display_loginstringThe specific display format of the username.
actor.gravatar_idstringThe unique identifier of the Gravatar profile for the actor.
actor.urlstringThe REST API URL used to retrieve the user object, which includes additional user information.
actor.avatar_urlstringThe URL of the actor's profile image.
repoobjectThe repository object where the event occurred.
repo.idintegerThe unique identifier of the repository.
repo.namestringThe name of the repository, which includes the owner and repository name. For example, octocat/hello-world is the name of the hello-world repository owned by the octocat personal account.
repo.urlstringThe REST API URL used to retrieve the repository object, which includes additional repository information.
payloadobjectThe event payload object is unique to the event type. See the event type below for the event API payload object.
publicbooleanWhether the event is visible to all users.
created_atstringThe date and time when the event was triggered. It is formatted according to ISO 8601.
orgobjectThe organization that was chosen by the actor to perform action that triggers the event.
The property appears in the event object only if it is applicable.
org.idintegerThe unique identifier for the organization.
org.loginstringThe name of the organization.
org.gravatar_idstringThe unique identifier of the Gravatar profile for the organization.
org.urlstringThe REST API URL used to retrieve the organization object, which includes additional organization information.
org.avatar_urlstringThe URL of the organization's profile image.

This example shows the format of the WatchEvent response when using the Events API.

HTTP/2 200
Link: <https://api..com/resource?page=2>; rel="next",
      <https://api..com/resource?page=5>; rel="last"
[
  {
    "type": "WatchEvent",
    "public": false,
    "payload": {
    },
    "repo": {
      "id": 3,
      "name": "octocat/Hello-World",
      "url": "https://api..com/repos/octocat/Hello-World"
    },
    "actor": {
      "id": 1,
      "login": "octocat",
      "gravatar_id": "",
      "avatar_url": "https://.com/images/error/octocat_happy.gif",
      "url": "https://api..com/users/octocat"
    },
    "org": {
      "id": 1,
      "login": "",
      "gravatar_id": "",
      "url": "https://api..com/orgs/",
      "avatar_url": "https://.com/images/error/octocat_happy.gif"
    },
    "created_at": "2011-09-06T17:26:27Z",
    "id": "12345"
  }
]

A commit comment is created. The type of activity is specified in the action property of the payload object. For more information, see REST API endpoints for commit comments.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action performed. Can be created.
commentobjectThe commit comment resource.

A Git branch or tag is created. For more information, see REST API endpoints for Git database.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
refstringThe git ref resource, or null if ref_type is repository.
ref_typestringThe type of Git ref object created in the repository. Can be either branch, tag, or repository.
master_branchstringThe name of the repository's default branch (usually main).
descriptionstringThe repository's current description.
pusher_typestringCan be either user or a deploy key.

A Git branch or tag is deleted. For more information, see the REST API endpoints for Git database REST API.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
refstringThe git ref resource.
ref_typestringThe type of Git ref object deleted in the repository. Can be either branch or tag.

A user forks a repository. For more information, see REST API endpoints for repositories.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
forkeeobjectThe created repository resource.

A wiki page is created or updated. For more information, see About wikis.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
pagesarrayThe pages that were updated.
pages[][page_name]stringThe name of the page.
pages[][title]stringThe current page title.
pages[][action]stringThe action that was performed on the page. Can be created or edited.
pages[][sha]stringThe latest commit SHA of the page.
pages[][html_url]stringPoints to the HTML wiki page.

Activity related to an issue or pull request comment. The type of activity is specified in the action property of the payload object. For more information, see the REST API endpoints for issues.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed on the comment. Can be one of created, edited, or deleted.
changesobjectThe changes to the comment if the action was edited.
changes[body][from]stringThe previous version of the body if the action was edited.
issueobjectThe issue the comment belongs to.
commentobjectThe comment itself.

Activity related to an issue. The type of activity is specified in the action property of the payload object. For more information, see the REST API endpoints for issues.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Can be one of opened, edited, closed, reopened, assigned, unassigned, labeled, or unlabeled.
issueobjectThe issue itself.
changesobjectThe changes to the issue if the action was edited.
changes[title][from]stringThe previous version of the title if the action was edited.
changes[body][from]stringThe previous version of the body if the action was edited.
assigneeobjectThe optional user who was assigned or unassigned from the issue.
labelobjectThe optional label that was added or removed from the issue.

Activity related to repository collaborators. The type of activity is specified in the action property of the payload object. For more information, see REST API endpoints for collaborators.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Can be added to indicate a user accepted an invitation to a repository.
memberobjectThe user that was added.
changesobjectThe changes to the collaborator permissions if the action was edited.
changes[old_permission][from]stringThe previous permissions of the collaborator if the action was edited.

When a private repository is made public.

This event returns an empty payload object.

Activity related to pull requests. The type of activity is specified in the action property of the payload object. For more information, see REST API endpoints for pull requests.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Can be one of opened, edited, closed, reopened, assigned, unassigned, review_requested, review_request_removed, labeled, unlabeled, and synchronize.
numberintegerThe pull request number.
changesobjectThe changes to the comment if the action was edited.
changes[title][from]stringThe previous version of the title if the action was edited.
changes[body][from]stringThe previous version of the body if the action was edited.
pull_requestobjectThe pull request itself.
reasonstringThe reason the pull request was removed from a merge queue if the action was dequeued.

Activity related to pull request reviews. The type of activity is specified in the action property of the payload object. For more information, see REST API endpoints for pull requests.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Can be created.
pull_requestobjectThe pull request the review pertains to.
reviewobjectThe review that was affected.

Activity related to pull request review comments in the pull request's unified diff. The type of activity is specified in the action property of the payload object. For more information, see REST API endpoints for pull requests.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed on the comment. Can be created.
changesobjectThe changes to the comment if the action was edited.
changes[body][from]stringThe previous version of the body if the action was edited.
pull_requestobjectThe pull request the comment belongs to.
commentobjectThe comment itself.

Activity related to a comment thread on a pull request being marked as resolved or unresolved. The type of activity is specified in the action property of the payload object.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Can be one of:
  • resolved - A comment thread on a pull request was marked as resolved.
  • unresolved - A previously resolved comment thread on a pull request was marked as unresolved.
pull_requestobjectThe pull request the thread pertains to.
threadobjectThe thread that was affected.

One or more commits are pushed to a repository branch or tag.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
push_idintegerUnique identifier for the push.
sizeintegerThe number of commits in the push.
distinct_sizeintegerThe number of distinct commits in the push.
refstringThe full git ref that was pushed. Example: refs/heads/main.
headstringThe SHA of the most recent commit on ref after the push.
beforestringThe SHA of the most recent commit on ref before the push.
commitsarrayAn array of commit objects describing the pushed commits. (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.)
commits[][sha]stringThe SHA of the commit.
commits[][message]stringThe commit message.
commits[][author]objectThe git author of the commit.
commits[][author][name]stringThe git author's name.
commits[][author][email]stringThe git author's email address.
commits[][url]urlURL that points to the commit API resource.
commits[][distinct]booleanWhether this commit is distinct from any that have been pushed before.

Activity related to a release. The type of activity is specified in the action property of the payload object. For more information, see the REST API endpoints for releases and release assets REST API.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Can be published.
changes[body][from]stringThe previous version of the body if the action was edited.
changes[name][from]stringThe previous version of the name if the action was edited.
releaseobjectThe release object.

Activity related to a sponsorship listing. The type of activity is specified in the action property of the payload object. For more information, see About Sponsors.

KeyTypeDescription
actionstringThe action that was performed. This can be created.
effective_datestringThe pending_cancellation and pending_tier_change event types will include the date the cancellation or tier change will take effect.
changes[tier][from]objectThe tier_changed and pending_tier_change will include the original tier before the change or pending change. For more information, see the pending tier change payload.
changes[privacy_level][from]stringThe edited event types include the details about the change when someone edits a sponsorship to change the privacy.

When someone stars a repository. The type of activity is specified in the action property of the payload object. For more information, see REST API endpoints for activity.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

KeyTypeDescription
actionstringThe action that was performed. Currently, can only be started.