{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dialogbrain-com/json-schema/dialogbrain-com-trigger-update-request-schema.json",
  "title": "TriggerUpdateRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dialogbrain-com-openapi.json#/components/schemas/TriggerUpdateRequest",
  "properties": {
    "trigger_type": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "incoming_message",
            "incoming_call",
            "schedule",
            "webhook",
            "event",
            "blockchain_event",
            "job_completed",
            "calendar_event",
            "lead_captured"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Trigger Type",
      "description": "New trigger type. OMIT to keep the existing type unchanged."
    },
    "conditions": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conditions",
      "description": "New trigger conditions (replaces existing). Same fields as trigger_create:\nkeywords, keyword_match, channel_types, context_types, group_mode,\nchannel_account_ids (only accounts THIS workspace answers), folder_ids, ai_tag_ids,\nai_filter_ids, ai_filter_mode,\nai_filters: [{id: 1}, {name: \"...\", description: \"...\"}] — shorthand: reference existing by id or create inline (calls Voyage embedding API). If a filter with the same name already exists, it is reused by id.\ncontact_states, cooldown_seconds, max_runs_per_thread_per_hour, once_per_thread (true: completes once per conversation, then the next matching trigger answers there).\ntemplate: the rule_based reply — a string, or a card object {text, attachments, buttons} whose buttons each carry exactly one of value|url|web_app; a card with buttons needs send_mode auto.\nhandoff: {agent_id, task} — rule_based owner only. After the rule's message has gone out, that agent runs on the same thread as its own trigger would, with task as the handoff brief; task may use {channel_type} and {thread_id} only. The target must be an active agentic or claude_channels agent in this workspace.\nincoming_call (voice pickup): answer_delay_s, plus auto_join and chat_ids for GROUP calls — auto_join true|false decides whether the bot enters on its own or the call becomes a pending invite, and OMITTING the key defers to the channel setting (trigger-when-present, then channel, then approval; absent and false are different answers). chat_ids scopes to specific Telegram groups (any id spelling) and must not be combined with channels whose calls have no chat, which never satisfy it. Conditions are REPLACED, so dropping a key clears it.\ncalendar_event: window_minutes_before (1-1440, required), channel_account_ids, keywords, prepare_meet_join.\nincoming_message: action \"reply_text\"|\"join_voice\" (join requires send_mode=auto), message_source \"real\"|\"transcript\"|\"both\".\ncalendar_event: run_mode \"text\"|\"voice\" (voice requires send_mode=auto).\nBoth: voice: {speak_first, vision_mode}"
    },
    "thread_ids": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Thread Ids",
      "description": "Replace the conversations this trigger is restricted to, by numeric thread id."
    },
    "blocked_sender_ids": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Blocked Sender Ids",
      "description": "People this agent must never answer, by phone number, username or address. Beats every other filter, and works for calls as well as messages. An empty list unblocks everyone."
    },
    "excluded_thread_ids": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Excluded Thread Ids",
      "description": "Replace the conversations this trigger never fires in, by numeric thread id. An exclusion always wins over `thread_ids`."
    },
    "send_mode": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "auto",
            "draft"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Send Mode",
      "description": "New send mode override. OMIT to leave the send-mode unchanged."
    },
    "enabled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Enabled",
      "description": "Enable or disable this trigger. OMIT to leave the enabled flag unchanged."
    },
    "target_session": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Session",
      "description": "Which Claude Code desktop session this trigger's runs go to (name / client id / session id from workspace.desktops). Only meaningful on a claude_channels agent. Pass \"\" to clear it and go back to deliver-only-when-one-desktop-is-connected. Stored as conditions.target_session."
    },
    "priority": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Priority",
      "description": "Trigger priority — lower numbers run first"
    }
  },
  "type": "object"
}