---
title: "Patch Automation"
method: PATCH
path: "/v1/automation/{automation_id}/update"
tags: ["automation"]
---

# Patch Automation

`PATCH /v1/automation/{automation_id}/update`

## Request

- Base URL: `https://api.linktodm.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.linktodm.com/v1/automation/{automation_id}/update`
- Auth: HTTP bearer

## Path parameters

- `automation_id` integer, required

## Request body

- AutomationDBEditPayload
  - `name` string, nullable
  - `type` 'Auto DM Link' | 'Auto DM Products' | 'Button Text' | 'Attachment': Stub schema.
  - `facebook_account_id` string, nullable
  - `instagram_business_account_id` string, nullable
  - `instagram_user_id` string, nullable
  - `media_type` 'IMAGE' | 'VIDEO' | 'CAROUSEL_ALBUM'
  - `media_url` string, nullable
  - `media_id` string, nullable
  - `keywords` string[], nullable
  - `dm_message` string, nullable
  - `attachment_id` integer, nullable
  - `disable_auto_reply` boolean, nullable
  - `auto_reply_messages` string[], nullable
  - `auto_reply_mode` 'MANUAL' | 'AI'
  - `auto_reply_ai_prompt` string, nullable
  - `auto_reply_limit` integer, nullable
  - `product_links` ProductLink[], nullable
    - `url` string, required
    - `image_url` string, nullable
    - `title` string, nullable
    - `url_label` string, nullable
    - `addition_buttons` AdditionButtonSchema[], nullable
      - `url` string, required
      - `url_label` string, nullable
  - `addition_buttons` AdditionButtonSchema[], nullable
    - `url` string, required
    - `url_label` string, nullable
  - `dm_quick_replies` QuickReplySchema[], nullable
    - `id` string
    - `label` string, required
    - `action` 'SEND_MESSAGE' | 'CONNECT_AUTOMATION' | 'NOTHING', required: What tapping a quick-reply chip does.
    - `message_type` 'Auto DM Link' | 'Auto DM Products' | 'Button Text' | 'Attachment': Stub schema.
    - `dm_message` string, nullable
    - `automation_id` integer, nullable
    - `flow_automation_id` integer, nullable
  - `ask_to_follow` boolean, nullable
  - `extra_data` AutomationExtraData
    - `ask_to_follow_title` string, nullable
    - `ask_to_follow_button_label` string, nullable
    - `ask_to_follow_error_title` string, nullable
    - `ask_to_follow_error_button_label` string, nullable
    - `ask_to_follow_visit_profile_button_label` string, nullable
    - `opener_message_type` 'Button Text' | 'Quick Reply Text'
    - `opener_message` string, nullable
    - `opener_message_button_label` string, nullable
    - `opener_message_additional_buttons` AdditionButtonSchema[], nullable
      - `url` string, required
      - `url_label` string, nullable
  - `step_delays` AutomationStepDelays: Optional per-step delays. A missing/None entry means the step runs immediately after the previous one. Each delay is relative to the previous step, so the chain is: trigger -> comment -> opener -> ask_to_follow -> dm.
    - `comment` StepDelay: Wait applied before a step runs, relative to the previous step.
      - `delay_in_seconds` integer, required
      - `delay_unit` 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS': Unit a user entered a wait duration in. Shared by the legacy automation step delays (`StepDelay.delay_unit`) and the flow builder's DELAY node / comment auto-reply delay. The backend always schedules with the canonical seconds value; this is what the UI round-trips so the editor can show the delay the way it was typed.
    - `opener` StepDelay: Wait applied before a step runs, relative to the previous step.
      - `delay_in_seconds` integer, required
      - `delay_unit` 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS': Unit a user entered a wait duration in. Shared by the legacy automation step delays (`StepDelay.delay_unit`) and the flow builder's DELAY node / comment auto-reply delay. The backend always schedules with the canonical seconds value; this is what the UI round-trips so the editor can show the delay the way it was typed.
    - `ask_to_follow` StepDelay: Wait applied before a step runs, relative to the previous step.
      - `delay_in_seconds` integer, required
      - `delay_unit` 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS': Unit a user entered a wait duration in. Shared by the legacy automation step delays (`StepDelay.delay_unit`) and the flow builder's DELAY node / comment auto-reply delay. The backend always schedules with the canonical seconds value; this is what the UI round-trips so the editor can show the delay the way it was typed.
    - `dm` StepDelay: Wait applied before a step runs, relative to the previous step.
      - `delay_in_seconds` integer, required
      - `delay_unit` 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS': Unit a user entered a wait duration in. Shared by the legacy automation step delays (`StepDelay.delay_unit`) and the flow builder's DELAY node / comment auto-reply delay. The backend always schedules with the canonical seconds value; this is what the UI round-trips so the editor can show the delay the way it was typed.
  - `is_active` boolean
  - `is_draft` boolean
  - `is_story` boolean, nullable
  - `is_universal` boolean, nullable
  - `trigger_type` 'STORY_MENTION' | 'CURRENT_MEDIA' | 'AD_MEDIA'
  - `disable_url_tracking` boolean, nullable
  - `disable_dm` boolean, nullable
  - `one_dm_per_user` boolean, nullable
  - `one_dm_per_user_window_hours` integer, nullable
  - `share_media_for_dm` boolean
  - `enable_opener_message` boolean, nullable
  - `keyword_trigger_type` 'ANY' | 'EXACT_MATCH' | 'EXCLUDE' | 'AI_INTENT'
  - `media_source` 'INSTAGRAM' | 'FACEBOOK'
  - `trigger_ai_prompt` string, nullable
  - `is_deleted` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
