docs/content/rest/activity/events.md

1.8 KiB

title shortTitle allowTitleToDifferFromFilename intro versions topics autogenerated
REST API endpoints for events Events true Use the REST API to interact with {% data variables.product.prodname_dotcom %} events.
fpt ghec ghes
* * *
API
rest

About {% data variables.product.prodname_dotcom %} events

{% data variables.product.prodname_dotcom %} events power the various activity streams on the site.

You can use the REST API to return different types of events triggered by activity on {% data variables.product.product_name %}. For more information about the specific events that you can receive, see "AUTOTITLE." Endpoints for repository issues are also available. For more information, see "AUTOTITLE."

Events are optimized for polling with the "ETag" header. If no new events have been triggered, you will see a "304 Not Modified" response, and your current rate limit will be untouched. There is also an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

$ curl -I {% data variables.product.rest_url %}/users/tater/events
> HTTP/2 200
> X-Poll-Interval: 60
> ETag: "a18c3bded88eb5dbb5c849a489412bf3"

# The quotes around the ETag value are important
$ curl -I {% data variables.product.rest_url %}/users/tater/events \
$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
> HTTP/2 304
> X-Poll-Interval: 60

Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).