Events

events

Methods

List Events -> OffsetPage<>
get/events

Retrieve a list of events.

Use the query parameter to filter events on key/value criteria.

Syntax:

  • key:value: matches events with metadata that contains a key named key with a value of value; use double quotes if the value contains spaces or special characters
  • key:value1,value2: matches events with metadata that contains a key named key with a value of either value1 or value2
  • key:*: matches events where any metadata that contains a key named key
  • *:value: matches events where any metadata that contains value as a value
  • foo: matches events with metadata where any key or value string contains foo

Multiple qualifiers can be used in the same query string; this will filter events where metadata matches the intersection of the qualifiers (AND).

Examples:

  • key1:value1 key2:value2: matches metadata that contains both a key named key1 with its value value1 and another key named key2 with its value value2
  • key:"value with spaces": matches metadata with a key named key and its value value with spaces
  • key:value foo: matches metadata that contains both a key named key with its value value and any key or value that contains the text foo

Note: The start and end query arguments will find any events which intersect the query range (inclusive of start and end).

query Parameters
createdAfter: string
Optional
(format: date-time)

Return all events created after this date and time

device: {
Optional
id: string
Optional

Equivalent to deviceId, and ignored if deviceId is supplied

name: string
Optional

Equivalent to deviceName, and ignored if deviceName is supplied

}
deviceId: string
Optional

Filter events matching device ID

deviceName: string
Optional

Name of device associated with the event

end: string
Optional
(format: date-time)

End of an inclusive time range

limit: number
Optional
(minimum: 0, maximum: 2000, default: 2000)

Maximum number of items to return

offset: number
Optional
(minimum: 0)

Number of items to skip before returning the results

query: string
Optional

Event query string. Comprises a space-separated list of event queries, where the syntax of those queries is described above.

sortBy:
Optional

field to sort response items by

"id"
"deviceId"
"deviceName"
"device.name"
"device.id"
"start"
"createdAt"
"updatedAt"
sortOrder:
Optional

Sort order for the sortBy field

"asc"
"desc"
start: string
Optional
(format: date-time)

Start of an inclusive time range

updatedAfter: string
Optional
(format: date-time)

Return all events updated after this date and time

Response fields
id: string

ID of the event

createdAt: string
(format: date-time)

When the event was created

end: string
(format: date-time)

Event end time (inclusive)

metadata: Record<string, unknown>

Any metadata associated with the event

start: string
(format: date-time)

Event start time (inclusive)

updatedAt: string
(format: date-time)

When the event was last updated

device:
Optional

ID and name of a device.

deviceId: string
Optional
Deprecated

ID of the device associated with the event.

deprecated: Use device.id instead.

Request example
200Example
Create An Event ->
post/events

Create a new event.

Note: Creating an new event currently requires a device ID or device name, however the device field on the Event resource responses is optional to allow future API expansion for attaching events to other types of resources.

Get An Event ->
get/events/{id}

Get an event

Delete An Event -> { id }
delete/events/{id}

Delete an event

Update An Event ->
patch/events/{id}

Update an event

Domain types

Event = { id, createdAt, end, 5 more... }