---
title: "Get resource events from selected device"
method: GET
path: "/api/v1/devices/{deviceId}/events"
tags: ["Resource Events"]
---

# Get resource events from selected device

`GET /api/v1/devices/{deviceId}/events`

Get all resource events that occurred on the device with given `deviceId`. Alternative is to call 'Get resource events' with `deviceIdFilter` query parameter.

## Query parameters

- `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` — 7 warning
  - 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`
  - added the new `NOT_MODIFIED` enum value to the `items/result/resourceLinksSnapshotTaken/resources/additionalProperties/status` response property for the response status `200`
  - …3 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/devices/:deviceId/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)
