---
title: "Run a module command"
method: POST
path: "/devices/{deviceId}/modules/{moduleName}/commands/{commandName}"
---

# Run a module command

`POST /devices/{deviceId}/modules/{moduleName}/commands/{commandName}`

Run a command on a module.

## Path parameters

- `deviceId` string, required
- `moduleName` string, required
- `commandName` string, required

## Query parameters

- `api-version` string, required

## Request body

- DeviceCommand — The device command definition.
  - `id` string — The request ID of the device command execution.
  - `connectionTimeout` integer — Connection timeout in seconds to wait for a disconnected device to come online. Defaults to 0 seconds.
  - `responseTimeout` integer — Response timeout in seconds to wait for a command completion on a device. Defaults to 30 seconds.
  - `request` unknown
  - `response` unknown
  - `responseCode` integer — The status code of the device command response.

## Response `201`

Success

- DeviceCommand — The device command definition.
  - `id` string — The request ID of the device command execution.
  - `connectionTimeout` integer — Connection timeout in seconds to wait for a disconnected device to come online. Defaults to 0 seconds.
  - `responseTimeout` integer — Response timeout in seconds to wait for a command completion on a device. Defaults to 30 seconds.
  - `request` unknown
  - `response` unknown
  - `responseCode` integer — The status code of the device command response.

## Other responses

- `default` — An error response received from the IoT Central Service.

---

[API](https://skmtc.net/azure/apis/iotcentral-iotcentral.md) · [All operations](https://skmtc.net/azure/apis/iotcentral-iotcentral/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/iotcentral-iotcentral/versions/565d8813cbd3/schema)
