Skip to main content
GET
/
events
JavaScript SDK
const events = await client.events.list({ filter: { startTime: { min: new Date('1 jan 2018') }, endTime: { max: new Date('1 jan 2019') } } });
{
  "items": [
    {
      "id": 4503599627370496,
      "lastUpdatedTime": 1730204346000,
      "createdTime": 1730204346000,
      "externalId": "my.known.id",
      "dataSetId": 4503599627370496,
      "startTime": 1730204346000,
      "endTime": 1730204346000,
      "type": "<string>",
      "subtype": "<string>",
      "description": "<string>",
      "metadata": {},
      "assetIds": [
        4503599627370496
      ],
      "source": "<string>"
    }
  ],
  "nextCursor": "<string>"
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Query Parameters

limit
integer
default:100

Limits the number of results to be returned. The maximum results returned by the server is 1000 even if you specify a higher limit.

Required range: 1 <= x <= 1000
cursor
string

Cursor for paging through results. In general, if a response contains a nextCursor property, it means that there may be more results, and you should pass that value as the cursor parameter in the next request.

Note that the cursor may or may not be encrypted, but either way, it is not intended to be decoded. Its internal structure is not a part of the public API, and may change without notice. You should treat it as an opaque string and not attempt to craft your own cursors.

Example:

"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"

minStartTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

maxStartTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

minEndTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

maxEndTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

minActiveAtTime
integer<int64>

Event is considered active from its startTime to endTime inclusive. If startTime is null, event is never active. If endTime is null, event is active from startTime onwards. activeAtTime filter will match all events that are active at some point from min to max, from min, or to max, depending on which of min and max parameters are specified.

Required range: x >= 0
Example:

1730204346000

maxActiveAtTime
integer<int64>

Event is considered active from its startTime to endTime inclusive. If startTime is null, event is never active. If endTime is null, event is active from startTime onwards. activeAtTime filter will match all events that are active at some point from min to max, from min, or to max, depending on which of min and max parameters are specified.

Required range: x >= 0
Example:

1730204346000

assetIds
string<jsonArray(int64)>

Asset IDs of equipment that this event relates to. Format is list of IDs serialized as JSON array(int64). Takes [ 1 .. 100 ] of unique items.

Example:

"[1238712837, 238712361376, 23786237623]"

assetExternalIds
string<jsonArray(string)>

Asset external IDs of equipment that this event relates to. Takes 1..100 unique items.

assetSubtreeIds
string<jsonArray(int64)>

Only include events that have a related asset in a subtree rooted at any of these assetIds (including the roots given). If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

Example:

"[1238712837, 238712361376, 23786237623]"

assetSubtreeExternalIds
string<jsonArray(string)>

Only include events that have a related asset in a subtree rooted at any of these assetExternalIds (including the roots given). If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

source
string

The source of this event.

Maximum string length: 128
type
string

Type of the event, e.g 'failure'.

Maximum string length: 64
subtype
string

SubType of the event, e.g 'electrical'.

Maximum string length: 64
minCreatedTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

maxCreatedTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

minLastUpdatedTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

maxLastUpdatedTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

externalIdPrefix
string

Filter by this (case-sensitive) prefix for the external ID.

Maximum string length: 255
Example:

"my.known.prefix"

partition
string

Splits the data set into N partitions. The attribute is specified as a "M/N" string, where M is a natural number in the interval of [1, N]. You need to follow the cursors within each partition in order to receive all the data.

The maximum number of allowed partitions (N) is 10.

Cognite rejects requests if you specify more than 10 partitions. When Cognite enforces this behavior, the requests result in a 400 Bad Request status.

Example:

"1/3"

includeMetadata
boolean
default:true

Whether the metadata field should be returned or not.

sort
string[]

Sort by an array of the selected fields. Syntax: ["<fieldname>:asc|desc"]. Default sort order is asc with short syntax: ["<fieldname>"]. Filter accepts the following field names: dataSetId, externalId, type, subtype, startTime, endTime, createdTime, lastUpdatedTime, source, description, metadata. Partitions are done independently of sorting, there's no guarantee on sort order between elements from different partitions.

Response

Paged response with list of events

A list of objects along with possible cursors to get the next or previous page of results.

items
object[]
required
nextCursor
string

Cursor to get the next page of results (if available).

Last modified on April 23, 2026