# Method: enterprises.devices.executeCommand

- [HTTP request](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.request_body)
  - [JSON representation](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.response_body)
  - [JSON representation](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.ExecuteDeviceCommandResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#body.aspect)
- [Examples](https://developers.google.com/nest/device-access/reference/rest/v1/enterprises.devices/executeCommand#examples)

Executes a command to device managed by the enterprise.

### HTTP request

`POST https://smartdevicemanagement.googleapis.com/v1/{name=enterprises/*/devices/*}:executeCommand`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` The name of the device requested. For example: "enterprises/XYZ/devices/123" |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "command": string, "params": { object } } ``` |

| Fields ||
|---|---|
| `command` | `string` The command name to execute, represented by the fully qualified protobuf message name. |
| `params` | ``object (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Struct` format)`` The command message to execute, represented as a Struct. |

### Response body

Response message for SmartDeviceManagementService.ExecuteDeviceCommand

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "results": { object } } ``` |

| Fields ||
|---|---|
| `results` | ``object (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Struct` format)`` The results of executing the command. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/sdm.service`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).