---
title: "Update DAG notification settings"
method: PUT
path: "/dags/{fileName}/notifications"
tags: ["notifications"]
---

# Update DAG notification settings

`PUT /dags/{fileName}/notifications`

Creates or replaces server-side notification settings for a DAG.
Secret values are accepted in the request but are never returned.
Existing secret values are preserved when omitted for an existing target.
Developer, manager, or admin only.

## Path parameters

- `fileName` string, regex, required — Name of the DAG file

## Query parameters

- `remoteNode` string

## Request body

- UpdateDAGNotificationsRequest — Request to replace DAG notification settings
  - `enabled` boolean, required — Whether notification delivery is enabled for this DAG
  - `events` NotificationEventType[], required
  - `targets` NotificationTargetInput[], required
    - `id` string — Stable target ID. Omit when creating a new target.
    - `name` string — Human-readable target name
    - `type` 'email' | 'webhook' | 'slack' | 'telegram' | 'teams', required — Notification delivery provider
    - `enabled` boolean, required — Whether this target receives notifications
    - `events` NotificationEventType[] — Optional target-level event filter. When omitted or empty, the target inherits DAG-level events.
    - `email` NotificationEmailTarget — Email notification target. SMTP transport is configured in workspace notification settings.
      - `from` string — Sender address. Defaults to the workspace SMTP sender.
      - `to` string[], required — Primary recipients
      - `cc` string[] — CC recipients
      - `bcc` string[] — BCC recipients
      - `subjectPrefix` string — Subject prefix. Defaults to [DAGU].
      - `subjectTemplate` string — Optional email subject template. When set, it replaces the generated subject.
      - `bodyTemplate` string — Optional email body template. When omitted, Dagu sends the default notification body.
      - `attachLogs` boolean — Attach DAG and step logs when available
    - `webhook` NotificationWebhookTargetInput — Outbound webhook target input. Values are encrypted at rest.
      - `url` string, uri — HTTP or HTTPS endpoint to POST notification payloads to. Omit on updates to preserve the existing URL.
      - `headers` object — Additional request headers. Values are encrypted at rest. When provided, this replaces the stored header set.
      - `clearHeaders` boolean — Clear all stored webhook headers.
      - `hmacSecret` string — Optional HMAC secret for X-Dagu-Signature. Omit on updates to preserve the existing secret.
      - `clearHmacSecret` boolean — Clear the stored HMAC secret.
      - `messageTemplate` string — Optional rendered message added to the webhook JSON payload as message.
      - `bodyTemplate` string — Optional request body template. When set, it replaces the default Dagu payload and must render to valid JSON. One request is sent per event. Supports the same tokens as messageTemplate plus {{message}}.
      - `allowInsecureHttp` boolean — Allow plain HTTP webhook URLs. Disabled by default.
      - `allowPrivateNetwork` boolean — Allow loopback or private network webhook targets. Disabled by default.
    - `slack` NotificationSlackTargetInput — Slack incoming webhook target input. Values are encrypted at rest.
      - `webhookUrl` string, uri — Slack incoming webhook URL. Omit on updates to preserve the existing URL.
      - `messageTemplate` string — Optional Slack message template. When omitted, Dagu sends the default notification text.
    - `telegram` NotificationTelegramTargetInput — Telegram Bot API target input. Bot token is encrypted at rest.
      - `botToken` string — Telegram bot token. Omit on updates to preserve the existing token.
      - `chatId` string — Telegram chat ID
      - `topicId` string — Optional Telegram topic ID (message thread ID) for forum groups
      - `messageTemplate` string — Optional Telegram message template. When omitted, Dagu sends the default notification text.
    - `teams` NotificationTeamsTargetInput — Microsoft Teams incoming webhook target input. Values are encrypted at rest.
      - `webhookUrl` string, uri — Microsoft Teams incoming webhook URL, from a Teams Workflows (Power Automate) trigger or a legacy connector. Must use HTTPS. Omit on updates to preserve the existing URL.
      - `messageTemplate` string — Optional Teams message template. When omitted, Dagu sends the default notification text.
  - `subscriptions` NotificationSubscriptionInput[]
    - `id` string — Stable subscription ID. Omit when creating a new subscription.
    - `channelId` string, required — Notification channel ID
    - `enabled` boolean, required — Whether this DAG subscription receives notifications
    - `events` NotificationEventType[] — Optional subscription-level event filter. When omitted or empty, the subscription inherits DAG-level events.

## Response `200`

DAG notification settings updated

- DAGNotificationSettings — Server-side DAG notification settings
  - `id` string, required — Stable settings ID
  - `dagName` string, required — Name of the DAG these settings apply to
  - `enabled` boolean, required — Whether notification delivery is enabled for this DAG
  - `events` NotificationEventType[], required — DAG run events that trigger notifications
  - `targets` NotificationTarget[], required — DAG-local notification targets kept for backward compatibility
    - `id` string, required — Stable target ID
    - `name` string — Human-readable target name
    - `type` 'email' | 'webhook' | 'slack' | 'telegram' | 'teams', required — Notification delivery provider
    - `enabled` boolean, required — Whether this target receives notifications
    - `events` NotificationEventType[] — Target-level event filter. Empty means the target inherits DAG-level events.
    - `email` NotificationEmailTarget — Email notification target. SMTP transport is configured in workspace notification settings.
      - `from` string — Sender address. Defaults to the workspace SMTP sender.
      - `to` string[], required — Primary recipients
      - `cc` string[] — CC recipients
      - `bcc` string[] — BCC recipients
      - `subjectPrefix` string — Subject prefix. Defaults to [DAGU].
      - `subjectTemplate` string — Optional email subject template. When set, it replaces the generated subject.
      - `bodyTemplate` string — Optional email body template. When omitted, Dagu sends the default notification body.
      - `attachLogs` boolean — Attach DAG and step logs when available
    - `webhook` NotificationWebhookTarget — Public outbound webhook target details
      - `urlConfigured` boolean, required — Whether a webhook URL is configured
      - `urlPreview` string — Redacted URL preview
      - `headers` object — Header names with redacted values
      - `hmacSecretConfigured` boolean, required — Whether an HMAC secret is configured
      - `messageTemplate` string — Optional rendered message added to the webhook JSON payload as message.
      - `bodyTemplate` string — Optional request body template that replaces the default Dagu payload.
      - `allowInsecureHttp` boolean — Whether this target allows plain HTTP webhook URLs
      - `allowPrivateNetwork` boolean — Whether this target allows loopback or private network webhook targets
    - `slack` NotificationSlackTarget — Public Slack target details
      - `webhookUrlConfigured` boolean, required — Whether a Slack incoming webhook URL is configured
      - `webhookUrlPreview` string — Redacted Slack webhook URL preview
      - `messageTemplate` string — Optional Slack message template. When omitted, Dagu sends the default notification text.
    - `telegram` NotificationTelegramTarget — Public Telegram target details
      - `botTokenConfigured` boolean, required — Whether a Telegram bot token is configured
      - `botTokenPreview` string — Redacted Telegram bot token preview
      - `chatId` string — Telegram chat ID
      - `topicId` string — Optional Telegram topic ID (message thread ID) for forum groups
      - `messageTemplate` string — Optional Telegram message template. When omitted, Dagu sends the default notification text.
    - `teams` NotificationTeamsTarget — Public Microsoft Teams target details
      - `webhookUrlConfigured` boolean, required — Whether a Microsoft Teams incoming webhook URL is configured
      - `webhookUrlPreview` string — Redacted Microsoft Teams webhook URL preview
      - `messageTemplate` string — Optional Teams message template. When omitted, Dagu sends the default notification text.
  - `subscriptions` NotificationSubscription[], required — Notification channels subscribed by this DAG
    - `id` string, required — Stable subscription ID
    - `channelId` string, required — Notification channel ID
    - `enabled` boolean, required — Whether this DAG subscription receives notifications
    - `events` NotificationEventType[] — Subscription-level event filter. Empty means the subscription inherits DAG-level events.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `updatedBy` string — User ID that last updated the settings

## Other responses

- `400` — Invalid notification settings
- `403` — Forbidden - insufficient permissions
- `404` — DAG not found
- `default` — Unexpected error

---

[API](https://skmtc.net/dagucloud/apis/dagu.md) · [All operations](https://skmtc.net/dagucloud/apis/dagu/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dagucloud/dagu/revisions/93cc41f2018a/schema)
