---
title: "Launch a command via a Trigger"
method: POST
path: "/api/command/trigger/{triggername}"
tags: ["Command Triggers"]
---

# Launch a command via a Trigger

`POST /api/command/trigger/{triggername}`

## Request

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

This endpoint allows you to launch a command based on a defined trigger.

#### Sample Requests

**Launch a Command via a Trigger**

```
curl --silent \
     -X 'POST' \
     -H "x-api-key: {API_KEY}" \
     "https://console.jumpcloud.com/api/command/trigger/{TriggerName}"
```
**Launch a Command via a Trigger passing a JSON object to the command**
```
curl --silent \
     -X 'POST' \
     -H "x-api-key: {API_KEY}" \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -d '{ "srcip":"192.168.2.32", "attack":"Cross Site Scripting Attempt" }' \
     "https://console.jumpcloud.com/api/command/trigger/{TriggerName}"
```

## Headers

- `x-org-id` string

## Request body

- object

## Response `200`

OK

- Triggerreturn
  - `triggered` string[]

## Other responses

- `401`

---

[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)
