---
title: "Run a command"
method: POST
path: "/api/runCommand"
tags: ["Commands"]
---

# Run a command

`POST /api/runCommand`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/runCommand`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/runCommand/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint allows you to run a command.
#### Sample Request

```
curl -X POST https://console.jumpcloud.com/api/runCommand \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}'
  -d '{"_id":"{commandID}", "systemIds":["systemId"]}'
```

## Request body

- object
  - `_id` string: The ID of the command.
  - `systemIds` string[]: An optional list of device IDs to run the command on. If omitted, the command will run on devices bound to the command.

## Response `200`

OK

- object
  - `queueIds` string[]
  - `workflowInstanceId` string

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/revisions/f396d9271b46?raw)
