dots.v2.functions.namespaces.byNamespace_id().triggers.byTrigger_name().put()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.functions.namespaces.byNamespace_id(namespace_id).triggers.byTrigger_name(trigger_name).put(body: Update_trigger, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithTrigger_namePutResponse>

Description

Updates the details of the given trigger. To update a trigger, send a PUT request to /v2/functions/namespaces/{namespace_id}/triggers/{trigger_name} with new values for the is_enabled or scheduled_details properties.

Parameters

Path Parameters

namespace_id string required

Example: fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

The ID of the namespace to be managed.

trigger_name string required

Example: my trigger

The name of the trigger to be managed.

Request Body

isEnabled boolean optional

Example: true

Indicates weather the trigger is paused or unpaused.

scheduledDetails object optional

Trigger details for SCHEDULED type, where body is optional.

Show child properties
cron string required

Example: * * * * *

valid cron expression string which is required for SCHEDULED type triggers.

body object or null optional

Optional data to be sent to function while triggering the function.

Show child properties
name string optional

Example: Welcome to DO!

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.functions.namespaces
    .byNamespace_id("fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").triggers
    .byTrigger_name("my trigger").put({
    isEnabled: true,
    scheduledDetails: {
        cron: "* * * * *",
        body: {
            name: "Welcome to DO!",
        },
    },
});

Response Example

Show Response Example
{
  "trigger": {
    "namespace": "fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "my trigger",
    "function": "hello",
    "type": "SCHEDULED",
    "is_enabled": true,
    "created_at": "2022-11-11T04:16:45Z",
    "updated_at": "2022-11-11T04:16:45Z",
    "scheduled_details": {
      "cron": "* * * * *"
    },
    "scheduled_runs": {
      "last_run_at": "2022-11-11T04:16:45Z",
      "next_run_at": "2022-11-11T04:16:45Z"
    }
  }
}

More Information

See /v2/functions/namespaces/{namespace_id}/triggers/{trigger_name} 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.