dots.v2.agents.triggers.byTrigger_id().rotateSecret.post()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.agents.triggers.byTrigger_id(trigger_id).rotateSecret.post(requestConfiguration?: RequestConfiguration<RotateSecretRequestBuilderPostQueryParameters>): Promise<undefined | Rotate_secret_response>

Description

Webhook triggers only (409 for cron). Issues a new secret (shown once) and moves the old value to the previous slot, where it keeps verifying deliveries until previous_secret_expires_at. Default grace is 5 minutes when grace_period_seconds is omitted, so deliveries already in flight (signed with the old value) still succeed while the customer updates their external system. After that instant the old value is refused with 401. Pass grace_period_seconds=0 to retire the old secret on this call (breach response), or a positive value (up to the server max, default 1 hour) for a custom window; above the max is 400.

Parameters

Path Parameters

trigger_id string required

Example: b1a0c6de-1f2e-4a3b-9c8d-0e1f2a3b4c5d

The trigger UUID.

Query Parameters

gracePeriodSeconds integer optional

Example: 300

How long the outgoing secret keeps verifying deliveries. Omit for the default (5 minutes). 0 retires the old secret immediately (compromised-secret path). Positive values set a custom window up to the server max (default 1 hour); above the max is 400. Send at most once with an explicit non-negative integer - bare keys, empty values, non-integers, negatives, and duplicates are 400.

Min: 0

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.agents.triggers
    .byTrigger_id("b1a0c6de-1f2e-4a3b-9c8d-0e1f2a3b4c5d").rotateSecret.post();

Response Example

Show Response Example
{
  "webhook_secret": "whsec_f6e5d4c3b2a1",
  "previous_secret_expires_at": "2026-07-27T12:05:00Z",
  "previous_secret_revoked": false
}

More Information

See /v2/agents/triggers/{trigger_id}/rotate-secret in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.