Commands

Update a 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"
}'

put/api/commands/{id}

Request

Headers

x-org-idstring

Request body

commandstring required

The command to execute on the server.

commandRunnersstring[]

An array of IDs of the Command Runner Users that can execute this command.

commandTarget'enterprise' | 'organization'

EP create target when enterprise command sharing is enabled. enterprise creates a default-shared Enterprise command (grants all current child orgs). organization creates a local command in targetOrganizationId (or the pinned org). Ignored when sharing is disabled.

targetOrganizationIdstring

Child organization ID for a local command when commandTarget is organization in Enterprise / View All context. Ignored for Enterprise create and when sharing is disabled.

commandTypestring required

The Command OS

filesstring[]

An array of file IDs to include with the command.

launchTypestring

How the command will execute.

listensTostring
namestring required
organizationstring

The ID of the organization.

schedulestring

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.

scheduleRepeatTypestring

When the command will repeat.

sudoboolean
systemsstring[]

Not used. Use /api/v2/commands/{id}/associations to bind commands to systems.

templatestring

The template this command was created from

timeoutstring

The time in seconds to allow the command to run for. The maximum value is 86400 seconds (1 day).

triggerstring

The name of the command trigger.

userstring

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

shellstring

The shell used to run the command.

timeToLiveSecondsinteger

Time in seconds a command can wait in the queue to be run before timing out

scheduleYearinteger

The year that a scheduled command will launch in.

descriptionstring

Description of the command.

aiGeneratedboolean

Whether this command was generated with AI assistance.

templatingRequiredboolean

Whether this command requires templating before execution.

managedBy'enterprise' | 'organization'

Command owner type (enterprise or organization).

Response

OK

commandstring required

The command to execute on the server.

commandRunnersstring[]

An array of IDs of the Command Runner Users that can execute this command.

commandTarget'enterprise' | 'organization'

EP create target when enterprise command sharing is enabled. enterprise creates a default-shared Enterprise command (grants all current child orgs). organization creates a local command in targetOrganizationId (or the pinned org). Ignored when sharing is disabled.

targetOrganizationIdstring

Child organization ID for a local command when commandTarget is organization in Enterprise / View All context. Ignored for Enterprise create and when sharing is disabled.

commandTypestring required

The Command OS

filesstring[]

An array of file IDs to include with the command.

launchTypestring

How the command will execute.

listensTostring
namestring required
organizationstring

The ID of the organization.

schedulestring

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.

scheduleRepeatTypestring

When the command will repeat.

sudoboolean
systemsstring[]

Not used. Use /api/v2/commands/{id}/associations to bind commands to systems.

templatestring

The template this command was created from

timeoutstring

The time in seconds to allow the command to run for. The maximum value is 86400 seconds (1 day).

triggerstring

The name of the command trigger.

userstring

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

shellstring

The shell used to run the command.

timeToLiveSecondsinteger

Time in seconds a command can wait in the queue to be run before timing out

scheduleYearinteger

The year that a scheduled command will launch in.

descriptionstring

Description of the command.

aiGeneratedboolean

Whether this command was generated with AI assistance.

templatingRequiredboolean

Whether this command requires templating before execution.

managedBy'enterprise' | 'organization'

Command owner type (enterprise or organization).

Changes

No recorded changes to this operation across all 1 revision of this API.