The event objects returned from the Events API endpoints have the same structure.
| Event API attribute name | Description |
|---|---|
id |
Unique identifier for the event. |
type |
The type of event. Events uses PascalCase for the name. |
actor |
The user that triggered the event. |
actor.id |
The unique identifier for the actor. |
actor.login |
The username of the actor. |
actor.display_login |
The specific display format of the username. |
actor.gravatar_id |
The unique indentifier of the Gravatar profile for the actor. |
actor.url |
The REST API URL used to retrieve the user object, which includes additional user information. |
actor.avatar_url |
The URL of the actor's profile image. |
repo |
The repository object where the event occurred. |
repo.id |
The unique identifier of the repository. |
repo.name |
The 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 user account. |
repo.url |
The REST API URL used to retrive the repository object, which includes additional repository information. |
payload |
The event payload object is unique to the event type. See the event type below for the event API payload object. |
This example shows the format of the WatchEvent response when using the Events API.
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
[
{
"type": "WatchEvent",
"public": true,
"payload": {
},
"repo": {
"id": 3,
"name": "octocat/Hello-World",
"url": "https://api.github.com/repos/octocat/Hello-World"
},
"actor": {
"id": 1,
"login": "octocat",
"gravatar_id": "",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"url": "https://api.github.com/users/octocat"
},
"org": {
"id": 1,
"login": "github",
"gravatar_id": "",
"url": "https://api.github.com/orgs/github",
"avatar_url": "https://github.com/images/error/octocat_happy.gif"
},
"created_at": "2011-09-06T17:26:27Z",
"id": "12345"
}
]