---
title: "Rotate trigger secret"
method: POST
path: "/v1/projects/{project_id}/triggers/{trigger_id}/rotate-secret"
tags: ["Triggers"]
---

# Rotate trigger secret

`POST /v1/projects/{project_id}/triggers/{trigger_id}/rotate-secret`

## Request

- Base URL: `https://api.naturali.ai`
- URL: `https://api.naturali.ai/v1/projects/{project_id}/triggers/{trigger_id}/rotate-secret`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.naturali.ai/authorize`, token URL `https://api.naturali.ai/token`, scopes: `mcp:access`)

Rotates the signing secret for a webhook trigger

## Path parameters

- `trigger_id` string, required

## Response `200`

Secret rotated

- TriggerWithSecret
  - `id` string
  - `project_id` string
  - `name` string
  - `description` string, nullable
  - `type` 'manual' | 'webhook' | 'schedule' | 'event'
  - `target_type` 'orchestration' | 'agent' | 'tool' | 'eval'
  - `target_id` string: Public ID of the target resource (orchestration, agent, tool, or eval)
  - `action` string, nullable: Tool targets only — the action for mcp tools
  - `input` object, nullable: Static input, shallow-merged under fire-time input. For `eval` targets the effective input may carry `agent_version` and `baseline_run_id`, which are passed to the queued run.
  - `cron` string, nullable: 5-field cron expression (UTC). Present only for schedule triggers
  - `event_pattern` string, nullable: Internal-event subscription pattern. Present only for event triggers: `*`, `prefix.*`, or an exact event name
  - `active` boolean
  - `policy_id` string, nullable: Optional boundary policy that further restricts firings
  - `next_fire_at` string, date-time, nullable: Read-only, schedule triggers only. Server-computed next fire time
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `secret` string: Webhook triggers only. Returned only on create and rotate

## Other responses

- `400`: Trigger is not a webhook trigger
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Trigger not found

---

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