> ## 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.

# Create Command

This endpoint allows you to create a new command.

NOTE: the system property in the command is not used. Use a POST to /api/v2/commands/{id}/associations to bind a command to a system.

#### Sample Request

```
curl -X POST https://console.jumpcloud.com/api/commands/ \
  -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.                                                                                                                         |
  | 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"}
{
	"commandRunners": [],
	"files": [],
	"systems": [],
	"command": "<string>",
	"commandType": "<string>",
	"launchType": "<string>",
	"listensTo": "<string>",
	"name": "<string>",
	"organization": "<string>",
	"schedule": "<string>",
	"scheduleRepeatType": "<string>",
	"sudo": true,
	"timeout": "<string>",
	"shell": "<string>",
	"timeToLiveSeconds": 180,
	"scheduleYear": 308,
	"id": "<string>",
	"_id": "<string>"
}
```

## Workflow Library Example

[Create Command with Jumpcloud and Send Results Via Email](https://library.blinkops.com/workflows/create-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/create-command-with-jumpcloud-and-send-results-via-email/canvas" />
</div>
