---
title: "Get resource events"
method: GET
path: "/api/v1/events"
tags: ["Resource Events"]
---

# Get resource events

`GET /api/v1/events`

All events from resources belonging to devices user is authorized to use are returned in form of a stream, chunk by chunk. Attach your reader and consume event by event. Filters allow you to select devices and resources of interest, and the timestamp filter allows to filter out events and return only those that occurred after a given time. Error response might be returned immediately, but also anytime during the stream reading.

## Query parameters

- `deviceId` string, uuid
- `resourceId` string[]
- `timestamp` integer

## Response `200`

Stream of events or error

- object[]
  - `result` object
    - `resourceLinksPublished` ResourceLinksPublished
      - `resources` ResourceLink[]
        - `href` string
        - `deviceId` string
        - `resourceTypes` string[]
        - `interfaces` string[]
        - `anchor` string
        - `title` string
        - `supportedContentTypes` string[]
        - `validUntil` string, int64
        - `policy` object
          - `bitFlags` integer
        - `endpointInformations` object[]
          - `endpoint` string
          - `priority` string, int64
      - `deviceId` string
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceLinksUnpublished` ResourceLinksUnpublished
      - `hrefs` string[]
      - `deviceId` string
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceLinksSnapshotTaken` ResourceLinksSnapshotTaken
      - `resources` object
      - `deviceId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
    - `resourceChanged` ResourceChanged
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
      - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
    - `resourceUpdatePending` ResourceUpdatePending
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `resourceInterface` string
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceUpdated` ResourceUpdated
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceRetrievePending` ResourceRetrievePending
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `resourceInterface` string
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceRetrieved` ResourceRetrieved
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceDeletePending` ResourceDeletePending
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceDeleted` ResourceDeleted
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceCreatePending` ResourceCreatePending
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceCreated` ResourceCreated
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
      - `content` Content
        - `data` string, byte
        - `contentType` string
        - `coapContentFormat` integer
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `resourceStateSnapshotTaken` ResourceStateSnapshotTaken
      - `resourceId` ResourceId
        - `deviceId` string, uuid
        - `href` string, url
      - `latestResourceChange` ResourceChanged
        - `resourceId` ResourceId
          - `deviceId` string, uuid
          - `href` string, url
        - `content` Content
          - `data` string, byte
          - `contentType` string
          - `coapContentFormat` integer
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
        - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'
      - `resourceCreatePendings` ResourceCreatePending[]
        - `resourceId` ResourceId
          - `deviceId` string, uuid
          - `href` string, url
        - `content` Content
          - `data` string, byte
          - `contentType` string
          - `coapContentFormat` integer
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
      - `resourceRetrievePendings` ResourceRetrievePending[]
        - `resourceId` ResourceId
          - `deviceId` string, uuid
          - `href` string, url
        - `resourceInterface` string
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
      - `resourceUpdatePendings` ResourceUpdatePending[]
        - `resourceId` ResourceId
          - `deviceId` string, uuid
          - `href` string, url
        - `resourceInterface` string
        - `content` Content
          - `data` string, byte
          - `contentType` string
          - `coapContentFormat` integer
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
      - `resourceDeletePendings` ResourceDeletePending[]
        - `resourceId` ResourceId
          - `deviceId` string, uuid
          - `href` string, url
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `deviceMetadataUpdatePending` DeviceMetadataUpdatePending
      - `deviceId` string
      - `twinEnabled` boolean
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `deviceMetadataUpdated` DeviceMetadataUpdated
      - `deviceId` string
      - `status` 'OFFLINE' | 'ONLINE'
      - `twinEnabled` boolean
      - `twinSynchronization` TwinSynchronization
        - `state` 'OUT_OF_SYNC' | 'DISABLED' | 'SYNCING' | 'IN_SYNC' — OUT_OF_SYNC - As soon as it connects after it was offline or when it goes errorless offline or when twin enabled has been changed to true. DISABLED - As soon as twin enabled is set to false. SYNCING - As soon as device connects, successfully signs in and batch observe is called on device from the cloud. IN_SYNC - As soon as current device resources values are received and applied to twin database. Twin was successfully reconciled after device reconnect and is kept up to date using an active subscription to device resource changes.
        - `syncingAt` string, int64
        - `inSyncAt` string, int64
        - `commandMetadata` CommandMetadata
          - `connectionId` string
          - `sequence` string, uint64
      - `auditContext` AuditContext
        - `userId` string
        - `correlationId` string
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
    - `deviceMetadataSnapshotTaken` DeviceMetadataSnapshotTaken
      - `deviceId` string
      - `deviceMetadataUpdated` DeviceMetadataUpdated
        - `deviceId` string
        - `status` 'OFFLINE' | 'ONLINE'
        - `twinEnabled` boolean
        - `twinSynchronization` TwinSynchronization
          - `state` 'OUT_OF_SYNC' | 'DISABLED' | 'SYNCING' | 'IN_SYNC' — OUT_OF_SYNC - As soon as it connects after it was offline or when it goes errorless offline or when twin enabled has been changed to true. DISABLED - As soon as twin enabled is set to false. SYNCING - As soon as device connects, successfully signs in and batch observe is called on device from the cloud. IN_SYNC - As soon as current device resources values are received and applied to twin database. Twin was successfully reconciled after device reconnect and is kept up to date using an active subscription to device resource changes.
          - `syncingAt` string, int64
          - `inSyncAt` string, int64
          - `commandMetadata` CommandMetadata
            - `connectionId` string
            - `sequence` string, uint64
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
      - `updatePendings` DeviceMetadataUpdatePending[]
        - `deviceId` string
        - `twinEnabled` boolean
        - `auditContext` AuditContext
          - `userId` string
          - `correlationId` string
        - `eventMetadata` EventMetadata
          - `version` string, uint64
          - `timestamp` string, int64
          - `connectionId` string
          - `sequence` string, uint64
      - `eventMetadata` EventMetadata
        - `version` string, uint64
        - `timestamp` string, int64
        - `connectionId` string
        - `sequence` string, uint64
  - `error` Error
    - `code` integer
    - `message` string
    - `details` object[]
      - `typeUrl` string
      - `value` string, byte

## Other responses

- `400` — Bad Request
- `401` — Not authorized

## Changes

> 42 revisions in range; 3 not diffed.

- **2023-10-03** `43d5d4e000ad` — 1 breaking, 7 warning
  - for the `query` request parameter `resourceId`, the type/format of property `items/` was specialized from `string`/`url` to `string`/`urlEncoded`
  - added the new `NOT_MODIFIED` enum value to the `items/result/resourceChanged/status` response property for the response status `200`
  - added the new `NOT_MODIFIED` enum value to the `items/result/resourceCreated/status` response property for the response status `200`
  - added the new `NOT_MODIFIED` enum value to the `items/result/resourceDeleted/status` response property for the response status `200`
  - …4 more
- **2022-11-08** `482579a45b1d` — 4 warning, 6 info
  - removed the optional property `items/result/deviceMetadataSnapshotTaken/deviceMetadataUpdated/shadowSynchronization` from the response with the `200` status
  - removed the optional property `items/result/deviceMetadataSnapshotTaken/updatePendings/items/shadowSynchronization` from the response with the `200` status
  - removed the optional property `items/result/deviceMetadataUpdatePending/shadowSynchronization` from the response with the `200` status
  - removed the optional property `items/result/deviceMetadataUpdated/shadowSynchronization` from the response with the `200` status
  - …6 more
- …earlier changes not shown

[Full history](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/changes/api/v1/events/get.md)

---

[API](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway.md) · [All operations](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/plgd-dev/plgd-http-gateway/revisions/bbfd9fa43407/schema)
