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

# Change trigger settings

`PATCH /api/agents/{agentId}/trigger/{triggerId}`

## Request

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

Change some of a trigger's settings in one update, keeping the rest. allowedChannelIds applies only to Slack triggers and schedule only to cron triggers.

## Path parameters

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

## Request body

- object
  - `name` string
  - `description` string
  - `allowedChannelIds` string[]: Slack triggers only: replaces the channels it answers in
  - `schedule` string: Cron triggers only: a cron expression
  - `enabled` boolean
  - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
  - `alertCreatedNotificationDestinationIds` string[]: Slack destinations to post to when the trigger creates an alert; empty turns it off

## Response `200`

Successful response

- object
  - `success` boolean, required
  - `data` object, required
    - `id` string, uuid, required
    - `agentId` string, uuid, required
    - `organizationId` string, uuid, required
    - `source` 'jira' | 'jira-automation' | 'slack' | 'linear' | 'cron' | 'webhook' | 'email' | 'bugcrowd' | 'hackerone' | 'zscaler' | 'darktrace' | 'seon', required
    - `eventMode` 'direct' | 'alert_source': First-class event behavior. Missing only on legacy serialized snapshots.
    - `name` string, required
    - `description` string, nullable
    - `enabled` boolean, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `secret` string, nullable
    - `cronSchedule` string, nullable
    - `emailAddress` string, nullable
    - `config` object, required
    - `lastRunAttemptedAt` string, nullable
    - `lastRunSucceededAt` string, nullable
    - `alertCreatedNotificationDestinationIds` string[]: Slack destinations notified when this trigger creates an alert. Status updates and escalations for the alert reply in the thread that notification starts.

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