Skip to main content

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

ParameterDescription
CommandThe command to execute on the server.
Command RunnersAn array of IDs of the Command Runner Users that can execute this command.
Command TypeThe Command OS.
NameDisplay name of the command.
SudoEnable as Global Administrator/Sudo on all device associations.
UserThe 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".

Advanced Parameters

ParameterDescription
FilesAn array of file IDs to include with the command.
Launch TypeHow the command will execute.
Listens To-
OrganizationThe ID of the organization.
Organization IDOrganization identifier that can be obtained from console settings.
ScheduleA 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 TypeWhen the command will repeat.
Schedule YearThe year that a scheduled command will launch in.
ShellThe shell used to run the command.
SystemsNot used. Use /api/v2/commands/{id}/associations to bind commands to systems.
TemplateThe template this command was created from.
Time To Live SecondsTime in seconds a command can wait in the queue to be run before timing out.
TimeoutThe time in seconds to allow the command to run for.
TriggerThe name of the command trigger.

Example Output

{
"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

Create Command with Jumpcloud and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop