Pontos de extremidade da API REST para eventos
Use a API REST para interagir com eventos do GitHub.
Sobre os eventos do GitHub
Os eventos do GitHub alimentar os diversos fluxos de atividade no site.
É possível usar a API REST para retornar diferentes tipos de eventos acionados pela atividade no GitHub. Para saber mais sobre os eventos específicos que podem ser recebidos, confira Tipos de eventos do GitHub. Pontos de extremidade para problemas de repositório também estão disponíveis. Para saber mais, confira Pontos de extremidade da API REST para eventos de issues.
Os eventos são otimizados para sondagem a com o cabeçalho "ETag". Se nenhum novo evento for iniciado, você verá uma resposta "304 Not Modified" e seu limite de taxa atual não será alterado. Há também um cabeçalho "X-Poll-Interval" que especifica quantas vezes (em segundos) você pode fazer uma sondagem. Em tempos de alta carga do servidor, o tempo pode aumentar. Obedeça o cabeçalho.
$ curl -I https://api.github.com/users/tater/events
> HTTP/2 200
> X-Poll-Interval: 60
> ETag: "a18c3bded88eb5dbb5c849a489412bf3"
# The quotes around the ETag value are important
$ curl -I https://api.github.com/users/tater/events \
$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
> HTTP/2 304
> X-Poll-Interval: 60
A linha do tempo incluirá até 300 eventos. Apenas eventos criados nos últimos 30 dias serão incluídos. Eventos mais antigos que 30 dias não serão incluídos (mesmo que o número total de eventos na linha do tempo seja inferior a 300).
List public events
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List public events"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List public events"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List public events"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
| 304 | Not modified | 
| 403 | Forbidden | 
| 503 | Service unavailable | 
Exemplos de código para "List public events"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/eventsResponse
Status: 200[
  {
    "id": "22249084947",
    "type": "WatchEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "action": "started"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-07T07:50:26Z"
  }
]List public events for a network of repositories
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List public events for a network of repositories"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List public events for a network of repositories"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| ownerstring ObrigatórioThe account owner of the repository. The name is not case sensitive. | 
| repostring ObrigatórioThe name of the repository without the  | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List public events for a network of repositories"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
| 301 | Moved permanently | 
| 304 | Not modified | 
| 403 | Forbidden | 
| 404 | Resource not found | 
Exemplos de código para "List public events for a network of repositories"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/networks/OWNER/REPO/eventsResponse
Status: 200[
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22237752260",
    "type": "WatchEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "action": "started"
    },
    "public": true,
    "created_at": "2022-06-08T23:29:25Z"
  }
]List public organization events
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List public organization events"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List public organization events"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| orgstring ObrigatórioThe organization name. The name is not case sensitive. | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List public organization events"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List public organization events"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/eventsResponse
Status: 200[
  {
    "id": "22237752260",
    "type": "WatchEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octo-org/octo-repo",
      "url": "https://api.github.com/repos/octo-org/octo-repo"
    },
    "payload": {
      "action": "started"
    },
    "public": true,
    "created_at": "2022-06-08T23:29:25Z",
    "org": {
      "id": 9919,
      "login": "octo-org",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/octo-org",
      "avatar_url": "https://avatars.githubusercontent.com/u/9919?"
    }
  },
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octo-org/octo-repo",
      "url": "https://api.github.com/repos/octo-org/octo-repo"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z",
    "org": {
      "id": 9919,
      "login": "octo-org",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/octo-org",
      "avatar_url": "https://avatars.githubusercontent.com/u/9919?"
    }
  }
]List repository events
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List repository events"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinado deve ter os seguintes conjuntos de permissões:
- "Metadata" repository permissions (read)
Esse ponto de extremidade pode ser usado sem autenticação ou as permissões acima mencionadas se apenas recursos públicos forem solicitados.
Parâmetros para "List repository events"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| ownerstring ObrigatórioThe account owner of the repository. The name is not case sensitive. | 
| repostring ObrigatórioThe name of the repository without the  | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List repository events"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List repository events"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/OWNER/REPO/eventsResponse
Status: 200[
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22237752260",
    "type": "WatchEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "action": "started"
    },
    "public": true,
    "created_at": "2022-06-08T23:29:25Z"
  }
]List events for the authenticated user
If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. Optional: use the fine-grained token with following permission set to view private events: "Events" user permissions (read).
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List events for the authenticated user"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List events for the authenticated user"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| usernamestring ObrigatórioThe handle for the GitHub user account. | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List events for the authenticated user"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List events for the authenticated user"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/users/USERNAME/eventsResponse
Status: 200[
  {
    "id": "22249084947",
    "type": "WatchEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "action": "started"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": false,
    "created_at": "2022-06-07T07:50:26Z"
  }
]List organization events for the authenticated user
This is the user's organization dashboard. You must be authenticated as the user to view this.
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List organization events for the authenticated user"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
O token refinado deve ter os seguintes conjuntos de permissões:
- "Events" organization permissions (read)
Parâmetros para "List organization events for the authenticated user"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| usernamestring ObrigatórioThe handle for the GitHub user account. | 
| orgstring ObrigatórioThe organization name. The name is not case sensitive. | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List organization events for the authenticated user"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List organization events for the authenticated user"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/users/USERNAME/events/orgs/ORGResponse
Status: 200[
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octo-org/octo-repo",
      "url": "https://api.github.com/repos/octo-org/octo-repo"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": false,
    "created_at": "2022-06-09T12:47:28Z",
    "org": {
      "id": 9919,
      "login": "octo-org",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/octo-org",
      "avatar_url": "https://avatars.githubusercontent.com/u/9919?"
    }
  },
  {
    "id": "22196946742",
    "type": "CreateEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octo-org/octo-repo",
      "url": "https://api.github.com/repos/octo-org/octo-repo"
    },
    "payload": {
      "ref": "master",
      "ref_type": "repository",
      "full_ref": "refs/heads/master",
      "master_branch": "master",
      "description": null,
      "pusher_type": "user"
    },
    "public": false,
    "created_at": "2022-06-07T07:50:26Z",
    "org": {
      "id": 9919,
      "login": "octo-org",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/octo-org",
      "avatar_url": "https://avatars.githubusercontent.com/u/9919?"
    }
  }
]List public events for a user
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List public events for a user"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List public events for a user"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| usernamestring ObrigatórioThe handle for the GitHub user account. | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List public events for a user"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List public events for a user"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/users/USERNAME/events/publicResponse
Status: 200[
  {
    "id": "22249084947",
    "type": "WatchEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "action": "started"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-08T23:29:25Z"
  }
]List events received by the authenticated user
These are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List events received by the authenticated user"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List events received by the authenticated user"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| usernamestring ObrigatórioThe handle for the GitHub user account. | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List events received by the authenticated user"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List events received by the authenticated user"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/users/USERNAME/received_eventsResponse
Status: 200[
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22196946742",
    "type": "CreateEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "ref": "master",
      "ref_type": "repository",
      "full_ref": "refs/heads/master",
      "master_branch": "master",
      "description": null,
      "pusher_type": "user"
    },
    "public": false,
    "created_at": "2022-06-07T07:50:26Z"
  }
]List public events received by a user
Note
This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
Tokens de acesso refinados para "List public events received by a user"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
- Tokens de acesso à instalação do aplicativo GitHub
- Tokens de acesso pessoal refinados
O token refinaado não requer permissões.
Parâmetros para "List public events received by a user"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| usernamestring ObrigatórioThe handle for the GitHub user account. | 
| Nome, Tipo, Descrição | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão:  | 
Códigos de status de resposta HTTP para "List public events received by a user"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "List public events received by a user"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/users/USERNAME/received_events/publicResponse
Status: 200[
  {
    "id": "22249084964",
    "type": "PushEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "repository_id": 1296269,
      "push_id": 10115855396,
      "ref": "refs/heads/master",
      "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300",
      "before": "883efe034920928c47fe18598c01249d1a9fdabd"
    },
    "public": true,
    "created_at": "2022-06-09T12:47:28Z"
  },
  {
    "id": "22196946742",
    "type": "CreateEvent",
    "actor": {
      "id": 583231,
      "login": "octocat",
      "display_login": "octocat",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4"
    },
    "repo": {
      "id": 1296269,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "payload": {
      "ref": "master",
      "ref_type": "repository",
      "full_ref": "refs/heads/master",
      "master_branch": "master",
      "description": null,
      "pusher_type": "user"
    },
    "public": false,
    "created_at": "2022-06-07T07:50:26Z"
  }
]