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

# Update trigger definition

`PUT /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

Modify metadata or configuration of an existing trigger.

## Path parameters

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

## Request body

- union
  - object
    - `name` string, required
    - `description` string
    - `source` 'slack', required
    - `allowedUserIds` string[]
    - `allowedUsergroupIds` string[]
    - `allowedChannelIds` string[]
    - `replyScope` 'anyone' | 'cotool_users': Who may reply in a Slack thread to continue this agent: anyone (any Slack user) or cotool_users (only mapped Cotool users with execute permission)
    - `reactionEmojis` string[]: Slack emoji short names (no colons) that trigger this agent when added as a reaction to a message, e.g. ["rotating_light"]. Empty or absent means reactions do not trigger this agent.
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'jira', required
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'jira-automation', required
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'linear', required
    - `linearMode` 'agent-session' | 'legacy-webhook'
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'cron', required
    - `schedule` string
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'webhook', required
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'email', required
    - `emailAddress` string, required
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'bugcrowd', required
    - `secret` string
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'hackerone', required
    - `secret` string
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'zscaler', required
    - `secret` string
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'darktrace', required
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean
  - object
    - `name` string, required
    - `description` string
    - `source` 'seon', required
    - `secret` string
    - `eventMode` 'direct' | 'alert_source': Whether an inbound event runs the configured agent directly or creates a Cotool alert before routing to the agent.
    - `createAlert` boolean

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