dots.v2.agents.triggers.byTrigger_id().patch()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.agents.triggers.byTrigger_id(trigger_id).patch(body: Update_trigger_request, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Get_trigger_response>

Description

Partial update: only the supplied fields change. kind and webhook.provider are immutable (409 on change). Mutable: name (409 on duplicate), status (active<->paused), prompt_template, output, session_template (fresh), bound_session_id (reuse), cron.cron_expr / cron.timezone (recomputes next_run_at). Re-enabling never produces a catch-up run. PATCHing session_template is a full replacement, so every spec.secrets slot value the new manifest declares must be resupplied (secret values are never echoed back), or the request is a 400.

Parameters

Path Parameters

trigger_id string required

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

The trigger UUID.

Request Body

name string optional

Example: nightly-deploy-check

New team-unique trigger name. Same charset/length rules as create.

Min length: 1

Max length: 64

status string optional

Trigger lifecycle state. Soft-deleted triggers are never returned (404).

One of: active, paused

promptTemplate string optional

Example: Review the latest push and summarize risks.

output object optional

Output-delivery configuration on create/update. Exactly one of email / slack is required for the matching mode and forbidden otherwise; destinations are stored encrypted and never returned.

Show child properties
mode string required

none = nothing pushed; the result stays in run history for self-serve. email = the collected run output is emailed to a configured address. slack = the collected run output is posted to a Slack incoming webhook URL (channel fixed by the webhook at install time).

One of: none, email, slack

email string optional

Example: [email protected]

Destination address; required iff mode=email.

slack object optional

Slack destination on create/update. webhook_url is required when mode=slack; must be https://hooks.slack.com/services/...; stored encrypted and never returned.

Show child properties
webhookUrl string required

Example: https://hooks.slack.com/services/T0000/B0000/XXXX

Slack incoming webhook URL (https://hooks.slack.com/services/...). The channel is bound to this URL at install time.

sessionTemplate string optional

fresh triggers only. A session_template PATCH is a full replacement of the stored template; you must resupply every spec.secrets slot value the new manifest declares, or the request is a 400.

boundSessionId string optional

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

reuse triggers only. UUID of an existing session owned by the team.

cron object optional

cron block on create.

Show child properties
cronExpr string required

Example: 0 9 * * 1-5

timezone string required

Example: America/New_York

IANA timezone.

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").patch({
    name: "nightly-deploy-check",
    status: "active",
    promptTemplate: "Review the latest push and summarize risks.",
    output: {
        mode: "email",
        email: "[email protected]",
        slack: {
            webhookUrl: "https://hooks.slack.com/services/T0000/B0000/XXXX",
        },
    },
    sessionTemplate: "",
    boundSessionId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    cron: {
        cronExpr: "0 9 * * 1-5",
        timezone: "America/New_York",
    },
});

Response Example

Show Response Example
{
  "trigger": {
    "trigger_id": "b1a0c6de-1f2e-4a3b-9c8d-0e1f2a3b4c5d",
    "kind": "webhook",
    "name": "nightly-deploy-check",
    "status": "active",
    "session_mode": "fresh",
    "agent_kind": "AGENT_KIND_UNSPECIFIED",
    "prompt_template": "Review the latest push and summarize risks.",
    "output": {
      "mode": "email",
      "email_configured": true,
      "slack_configured": false
    },
    "session_template": "",
    "bound_session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "webhook": {
      "provider": "github",
      "webhook_url": "https://api.digitalocean.com/v2/agents/triggers/b1a0.../webhook"
    },
    "cron": {
      "cron_expr": "0 9 * * 1-5",
      "timezone": "America/New_York",
      "next_run_at": "2026-07-27T13:00:00Z"
    },
    "created_at": "2026-07-27T12:00:00Z",
    "updated_at": "2026-07-27T12:00:00Z"
  }
}

More Information

See /v2/agents/triggers/{trigger_id} 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.