---
title: "Get all pending commands"
method: GET
path: "/api/v1/pending-commands"
tags: ["Pending Commands"]
---

# Get all pending commands

`GET /api/v1/pending-commands`

Resource shadow can be updated even if the device is offline. Each update request creates a pending command which is executed at the moment devices comes online. If the device is offline, this API allows you to retrieve all pending commands in form of a stream. Various filters allows you to be more concrete in pending commands you would like to get. Error response might be returned immediately, but also anytime during the stream reading.

## Query parameters

- `deviceId` string, uuid
- `type` string[]
- `resourceId` string[]
- `command` CommandType[]

## Response `200`

Stream of resource links or errors.

- object
  - `result` ResourceLinks
    - `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
  - `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
  - for the `query` request parameter `resourceId`, the type/format of property `items/` was specialized from `string`/`url` to `string`/`urlEncoded`
- **2022-01-05** `afc9b9af73b5` — 6 info
  - added the optional property `error/details/items/typeUrl` to the response with the `200` status
  - added the optional property `error/details/items/typeUrl` to the response with the `400` status
  - added the optional property `error/details/items/typeUrl` to the response with the `401` status
  - added the optional property `error/details/items/value` to the response with the `200` status
  - …2 more
- **2021-10-01** `4508be528e8a` — 1 warning, 1 info
  - removed the optional property `result/resources/items/policies` from the response with the `200` status
  - added the optional property `result/resources/items/policy` to the response with the `200` status
- **2021-07-27** `4d121732b593` — 1 info
  - endpoint added
- **2020-04-11** `562192db9767` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/changes/api/v1/pending-commands/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)
