---
title: "Update trigger event mode"
method: PATCH
path: "/api/agents/{agentId}/trigger/{triggerId}/event-mode"
tags: ["Agent Triggers"]
---

# Update trigger event mode

`PATCH /api/agents/{agentId}/trigger/{triggerId}/event-mode`

## Request

- Base URL: `https://app.cotool.ai`
- URL: `https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode`
- Auth: HTTP bearer

Set whether a trigger creates an alert before running the agent or runs the agent directly.

## Path parameters

- `agentId` string, uuid, required: Unique identifier of the agent
- `triggerId` string, uuid, required: Unique identifier of the trigger

## Request body

- object: Request body for updating whether a trigger creates alerts
  - `eventMode` 'direct' | 'alert_source', required: Run the agent directly or create an alert before running it

## Response `200`

Successful response

- object: Response confirming trigger event mode update
  - `success` boolean, required: Whether the event mode update was successful
  - `eventMode` 'direct' | 'alert_source', required: Current event mode of the trigger after update

## Other responses

- `400`: Bad request — input validation failed or the request was malformed
- `401`: Unauthorized — missing or invalid API key / session
- `403`: Forbidden — the authenticated user lacks the required permissions
- `500`: Internal server error

---

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