> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run command for Sensors

> This endpoint lets you run a command for one or more Sensor records.

# Run command for Sensors

This endpoint lets you run a command for one or more Sensor records.

## Authentication

> [!NOTE]
>
> This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.

## Request Body

**Key** `string` *required*

The key for the command to execute.

**Ids** `array` *required*

The list of record identifiers (Id field) for the Sensor records to execute this command for.

**Parameters** `array` *required*

If this command requires any parameters, the name and value for each of them.

## Response

### 200

**Status** `integer`

Example: `200`

**Message** `string`

Example: `The command was run correctly.`

**Value** `object`

**RedirectURL** `any`

**UpdatedOn** `string`

Example: `2021-04-15T12:19:07Z`

**UpdatedBy** `string`

Example: `john@example.com`

**Errors** `any`

**WasSuccessful** `boolean`

Example: `true`

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "The command was run correctly.",
  "Value": {
    "Id": 10605
  },
  "RedirectURL": null,
  "UpdatedOn": "2021-04-15T12:19:07Z",
  "UpdatedBy": "john@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

## Example Request

```bash theme={null}
curl -X POST \
  "https://spaces.nexudus.com/api/sys/sensors/runcommand" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.