---
title: "Update"
method: PUT
path: "/v2/storage/triggers/{triggerId}"
tags: ["Triggers"]
---

# Update

`PUT /v2/storage/triggers/{triggerId}`

## Request

- Base URL: `https://connection.keboola.com`
- URL: `https://connection.keboola.com/v2/storage/triggers/{triggerId}`
- Auth: one of:
  - API key in header `X-StorageApi-Token`
  - API key in header `X-KBC-ManageApiToken`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/keboola/apis/keboola-storage-api/docs/v2/storage/triggers/:triggerId/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates an existing trigger. All attributes are optional; only the provided ones are changed.

When updating the component of trigger you need permissions for both the current component and the component you're updating the trigger to.

Giving a trigger another `runWithTokenId` revokes the token the trigger created for itself, unless another trigger still runs with it.

## Path parameters

- `triggerId` integer, required

## Request body

- UpdateTriggerRequest
  - `runWithTokenId` integer: ID of the token that runs the configured component. Replacing the token the trigger created for itself revokes that token.
  - `component` string: Component ID of the triggered configuration (typically `orchestration`).
  - `configurationId` string: ID of component configuration.
  - `coolDownPeriodMinutes` integer: Minimal cool down period before firing action again in minutes (min is 1 minute).
  - `tableIds` string[]: IDs of tables to watch (like `in.c-test.watched`). Replaces the current set.

## Response `200`

Trigger updated.

- TriggerResponse
  - `id` string, required: Trigger ID.
  - `runWithTokenId` integer, required: ID of token used for running configured component.
  - `component` string, required: Component ID of the triggered configuration.
  - `configurationId` string, required: ID of component configuration.
  - `lastRun` string, nullable, required: Time of the last trigger run, ISO 8601 with a `+hhmm` offset; `null` if never fired.
  - `creatorToken` object, required: Token that created the trigger.
    - `id` integer, required: Token ID.
    - `description` string, required: Token description.
  - `actor` ActorResponse, required: Who performed the action and through which credential.
    - `type` 'token' | 'session' | 'pat' | 'system', required: Credential the action came through: a Storage token, a programmatic session, a personal access token, or system work.
    - `id` string, required: Token id as a string, session or personal access token UUID, or the system subject.
    - `name` string, required: Token description, the admin email for a session or personal access token, or the system label, as it was when the action happened.
    - `adminId` integer, nullable, required: Admin behind the credential; null for a token without an admin, for system work, and when the admin was not recorded (an object whose creator is known only from its token columns, including rows backfilled from them).
  - `coolDownPeriodMinutes` integer, required: Minimal cool down period before firing action again in minutes.
  - `tables` object[], required: Watched tables.
    - `tableId` string, required: Table ID.

## Other responses

- `400`: Invalid request parameters (`storage.triggers.missingParam`), or invalid `runWithTokenId` (`storage.triggers.invalidTokenPair`, `storage.triggers.invalidRunByToken`).
- `404`: Trigger not found (`storage.triggers.notFound`).
- `422`: Cool down period shorter than 1 minute (`storage.triggers.missingParam`), table from an external bucket (`storage.triggers.triggerOnTableFromExternalBucket`), or insufficient privilege for the component (`storage.triggers.insufficientPrivilege`).

---

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