# Event

API to fetch device events.

## Get Events.

> Long poll or stream device event data.

```json
{"openapi":"3.0.3","info":{"title":"Hue CLIP API","version":"v2"},"tags":[{"name":"Event","description":"API to fetch device events."}],"servers":[{"url":"https://{bridgeInternalIPAddress}","description":"Your Home Bridge","variables":{"bridgeInternalIPAddress":{"default":"192.168.1.0","description":"Use the broker server discover process by visiting https://discovery.meethue.com\nto discover the IP address of the bridge on your network\n"}}}],"security":[{"HueApplicationKey":[]}],"components":{"securitySchemes":{"HueApplicationKey":{"type":"apiKey","in":"header","name":"hue-application-key"}},"schemas":{"Event":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$","description":"A UUID that identifies this batch of events."},"type":{"type":"string","enum":["add","delete","error","update"]},"creationtime":{"type":"string","format":"date-time","description":"Time of creation for this batch of events."},"data":{"type":"array","description":"Array of resources affected by this batch of events.","items":{"description":"Individual resource data","allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","additionalProperties":true}]}}},"required":["id","creationtime","data","type"]},"Resource":{"type":"object","description":"Common resource properties","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of the supported resources"},"id":{"type":"string","description":"Unique identifier representing a specific resource instance","pattern":"^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$"},"id_v1":{"type":"string","description":"Clip v1 resource identifier","pattern":"^(\\/[a-z]{4,32}\\/[0-9a-zA-Z-]{1,32})?$"}}},"ErrorResponse":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","required":["description"],"properties":{"description":{"type":"string","description":"a human-readable explanation specific to this occurrence of the problem."}}}},"responses":{"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"MethodNotAllowed":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotAcceptable":{"description":"Not Acceptable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Conflict":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InsufficientStorage":{"description":"Insufficient Storage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/eventstream/clip/v2":{"get":{"operationId":"getEventStream","summary":"Get Events.","description":"Long poll or stream device event data.","tags":["Event"],"parameters":[{"name":"If-None-Match","in":"header","required":false,"description":"Unix timestamp of the last seen event, followed by `:0`.\n\nIf any events in the server's buffer have a timestamp greater than this,\nthe server will send them immediately instead of blocking for new events.\nThe server does not maintain a persistent buffer and purges old events\nafter several minutes and does not indicate when the value of\nIf-None-Match falls outside of its buffered window, so clients must poll\nconsistently often else events will be silently missed.\n","schema":{"type":"string"}}],"responses":{"200":{"description":"Events Success Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"text/event-stream":{"encoding":{"id":{"contentType":"text/plain"},"data":{"contentType":"application/json"}},"schema":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/MethodNotAllowed"},"406":{"$ref":"#/components/responses/NotAcceptable"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"507":{"$ref":"#/components/responses/InsufficientStorage"}}}}}}
```
