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

# Update Command

This endpoint Updates a command based on the command ID and returns the modified command record.

#### Sample Request

```
curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
	"name":"Test API Command",
	"command":"String",
	"user":"{UserID}",
	"schedule":"",
	"timeout":"100"
}'

```

## Basic Parameters

<div className="integrations-table">
  | Parameter       | Description                                                                                                                             |
  | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
  | Command         | The command to execute on the server.                                                                                                   |
  | Command Runners | An array of IDs of the Command Runner Users that can execute this command.                                                              |
  | Command Type    | The Command OS.                                                                                                                         |
  | ID              | The command ID.                                                                                                                         |
  | Name            | Display name of the command.                                                                                                            |
  | Sudo            | Enable as Global Administrator/Sudo on all device associations.                                                                         |
  | User            | The ID of the system user to run the command as. This field is required when creating a command with a commandType of "mac" or "linux". |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter            | Description                                                                                                                                                                       |
  | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Files                | An array of file IDs to include with the command.                                                                                                                                 |
  | Launch Type          | How the command will execute.                                                                                                                                                     |
  | Listens To           | -                                                                                                                                                                                 |
  | Organization         | The ID of the organization.                                                                                                                                                       |
  | Organization ID      | Organization identifier that can be obtained from console settings.                                                                                                               |
  | Schedule             | A crontab that consists of: \[ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or \[ immediate ]. If you send this as an empty string, it will run immediately. |
  | Schedule Repeat Type | When the command will repeat.                                                                                                                                                     |
  | Schedule Year        | The year that a scheduled command will launch in.                                                                                                                                 |
  | Shell                | The shell used to run the command.                                                                                                                                                |
  | Systems              | Not used. Use /api/v2/commands/{id}/associations to bind commands to systems.                                                                                                     |
  | Template             | The template this command was created from.                                                                                                                                       |
  | Time To Live Seconds | Time in seconds a command can wait in the queue to be run before timing out.                                                                                                      |
  | Timeout              | The time in seconds to allow the command to run for.                                                                                                                              |
  | Trigger              | The name of the command trigger.                                                                                                                                                  |
</div>

## Example Output

```json theme={"dark"}
{
	"command": "string",
	"commandRunners": [
		"string"
	],
	"commandType": "linux",
	"files": [
		"string"
	],
	"launchType": "string",
	"listensTo": "string",
	"name": "string",
	"organization": "string",
	"schedule": "string",
	"scheduleRepeatType": "string",
	"scheduleYear": 0,
	"shell": "string",
	"sudo": true,
	"systems": [
		"string"
	],
	"template": "string",
	"timeToLiveSeconds": 0,
	"timeout": "string",
	"trigger": "string",
	"user": "string"
}
```

## Workflow Library Example

[Update Command with Jumpcloud and Send Results Via Email](https://library.blinkops.com/workflows/update-command-with-jumpcloud-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/update-command-with-jumpcloud-and-send-results-via-email/canvas" />
</div>
