---
title: "Update a trigger"
method: POST
path: "/triggers/{id}"
tags: ["Triggers"]
---

# Update a trigger

`POST /triggers/{id}`

## Path parameters

- `id` string, required

## Request body

- union
  - object
    - `project_defined_event` string, required — The ID of a project defined event
    - `name` string — The name of the trigger
    - `email_address` string, nullable — The ID of an email address or project email address. Will be used to send emails as part of this trigger
    - `phone_number` string, nullable — The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger
    - `excluded_customers` string[] — The IDs of the customers excluded by the trigger
    - `metadata` object, nullable — Metadata for the trigger
    - `steps` union[] — The steps of the trigger
      - union
        - object
          - `type` 'email', required — The step type. Always "email" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
          - `email_template_id` string, required — The ID of the email template to use in this step
        - object
          - `type` 'email', required — The step type. Always "email" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
          - `subject` string, required — The subject of the email template to use at this step
          - `body` string, required — The body of the email template to use at this step
        - object
          - `type` 'sms', required — The step type. Always "sms" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
          - `sms_template_id` string, required — The ID of the SMS template to use in this step
        - object
          - `type` 'sms', required — The step type. Always "sms" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
          - `message` string, required — The message to send in this step
        - object
          - `type` 'wait', required — The step type. Always "wait" for this step
          - `duration` integer, required — The number of seconds to wait
        - object
          - `type` 'if', required — The step type. Always "if" for this step
          - `filter` string, required — The filter to use in this step
  - object
    - `internal_event_definition` object, required — The internal event definition that triggers the trigger
      - `type` 'customer_created' | 'customer_joined_segment' | 'customer_birthday', required — The type of internal event definition. Must be 'customer_created', 'customer_joined_segment', or 'customer_birthday'
      - `segment` string, nullable — The ID of the segment that the customer joined. Can only be provided with 'customer_joined_segment'
    - `name` string — The name of the trigger
    - `email_address` string, nullable — The ID of an email address or project email address. Will be used to send emails as part of this trigger
    - `phone_number` string, nullable — The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger
    - `excluded_customers` string[] — The IDs of the customers excluded by the trigger
    - `metadata` object, nullable — Metadata for the trigger
    - `steps` union[] — The steps of the trigger
      - union
        - object
          - `type` 'email', required — The step type. Always "email" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
          - `email_template_id` string, required — The ID of the email template to use in this step
        - object
          - `type` 'email', required — The step type. Always "email" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
          - `subject` string, required — The subject of the email template to use at this step
          - `body` string, required — The body of the email template to use at this step
        - object
          - `type` 'sms', required — The step type. Always "sms" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
          - `sms_template_id` string, required — The ID of the SMS template to use in this step
        - object
          - `type` 'sms', required — The step type. Always "sms" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
          - `message` string, required — The message to send in this step
        - object
          - `type` 'wait', required — The step type. Always "wait" for this step
          - `duration` integer, required — The number of seconds to wait
        - object
          - `type` 'if', required — The step type. Always "if" for this step
          - `filter` string, required — The filter to use in this step
  - object
    - `name` string — The name of the trigger
    - `email_address` string, nullable — The ID of an email address or project email address. Will be used to send emails as part of this trigger
    - `phone_number` string, nullable — The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger
    - `excluded_customers` string[] — The IDs of the customers excluded by the trigger
    - `metadata` object, nullable — Metadata for the trigger
    - `steps` union[] — The steps of the trigger
      - union
        - object
          - `type` 'email', required — The step type. Always "email" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
          - `email_template_id` string, required — The ID of the email template to use in this step
        - object
          - `type` 'email', required — The step type. Always "email" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
          - `subject` string, required — The subject of the email template to use at this step
          - `body` string, required — The body of the email template to use at this step
        - object
          - `type` 'sms', required — The step type. Always "sms" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
          - `sms_template_id` string, required — The ID of the SMS template to use in this step
        - object
          - `type` 'sms', required — The step type. Always "sms" for this step
          - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
          - `message` string, required — The message to send in this step
        - object
          - `type` 'wait', required — The step type. Always "wait" for this step
          - `duration` integer, required — The number of seconds to wait
        - object
          - `type` 'if', required — The step type. Always "if" for this step
          - `filter` string, required — The filter to use in this step

## Response `200`

The updated `Trigger` object

- Trigger
  - `id` string, required — The ID of the trigger
  - `created_at` string, required — The time when the trigger was created in ISO 8601 format
  - `updated_at` string, required — The time when the trigger was last updated in ISO 8601 format
  - `name` string, required — The name of the trigger
  - `project_defined_event` string, nullable, required — The ID of the project-defined event that triggers the trigger
  - `internal_event_definition` object, nullable, required — The internal event definition that triggers the trigger
    - `type` 'customer_created' | 'customer_joined_segment' | 'customer_birthday', required — The type of internal event definition. Must be 'customer_created', 'customer_joined_segment', or 'customer_birthday'
    - `segment` string, nullable — The ID of the segment that the customer joined. Can only be provided with 'customer_joined_segment'
  - `trigger` string, nullable — Deprecated. Will always be null
  - `steps` union[], required — The steps of the trigger
    - union
      - object
        - `type` 'email', required — The step type. Always "email" for this step
        - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
        - `email_template_id` string, required — The ID of the email template to use in this step
      - object
        - `type` 'email', required — The step type. Always "email" for this step
        - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "email" as well
        - `subject` string, required — The subject of the email template to use at this step
        - `body` string, required — The body of the email template to use at this step
      - object
        - `type` 'sms', required — The step type. Always "sms" for this step
        - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
        - `sms_template_id` string, required — The ID of the SMS template to use in this step
      - object
        - `type` 'sms', required — The step type. Always "sms" for this step
        - `custom_step_id` string — Optional. The ID of the custom step to use in this step. The type of the custom step must be "sms" as well
        - `message` string, required — The message to send in this step
      - object
        - `type` 'wait', required — The step type. Always "wait" for this step
        - `duration` integer, required — The number of seconds to wait
      - object
        - `type` 'if', required — The step type. Always "if" for this step
        - `filter` string, required — The filter to use in this step
  - `status` 'draft' | 'active' | 'inactive', required — The status of the trigger. One of "draft", "active", or "inactive"
  - `filter` string, nullable, required — An additional filter that determines if the trigger should be run
  - `email_address` string, nullable, required — The ID of the email address or project email address associated with the trigger. Will be used to send emails as part of this trigger
  - `phone_number` string, nullable, required — The ID of the phone number or project phone number associated with the trigger. Will be used to send SMS messages as part of this trigger
  - `attributed_revenue` union, required — The revenue attributed to the trigger
    - number
    - string
  - `metadata` object, required — Arbitrary metadata associated with this trigger
  - `statistics` object, required — The statistics of the trigger. Includes information about customers enrolled, email statistics, and custom step statistics
    - `total_customers_enrolled` integer — The number of customers enrolled in the campaign or trigger
    - `total_customers_started` integer — The number of customers who have started receiving messages
    - `total_customers_finished` integer — The number of customers who have finished receiving all the messages
    - `emails` object, required — Email statistics including sent, delivered, opened, bounced, and clicked counts
      - `sent` integer, required — The number of emails sent
      - `delivered` integer, required — The number of emails delivered
      - `opened` integer, required — The number of emails opened
      - `soft_bounced` integer, required — The number of emails that soft bounced
      - `hard_bounced` integer, required — The number of emails that hard bounced
      - `spam_reported` integer, required — The number of emails reported as spam
      - `clicked` integer, nullable, required — The number of emails clicked (null if tracking not enabled)
    - `custom_steps` object[], required — Statistics for custom steps
      - `custom_step` string, required — The ID of the custom step
      - `sent` integer, required — The number of times this custom step was sent
    - `executions` object, required — Execution statistics
      - `total` integer, required — Total number of executions
      - `pending` integer, required — Number of pending executions
      - `started` integer, required — Number of started executions
      - `finished` integer, required — Number of finished executions
      - `errored` integer, required — Number of errored executions
    - `sms` object, required — SMS statistics
      - `sms_sent_count` integer, required — The number of SMS messages sent
      - `sms_sent_segments_count` integer, required — The number of SMS messages segments
      - `mms_sent_count` integer, required — The number of MMS messages sent
      - `mms_sent_segments_count` integer, required — The number of MMS messages segments

---

[API](https://skmtc.dev/pocketflows/apis/pocketflows-api.md) · [All operations](https://skmtc.dev/pocketflows/apis/pocketflows-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pocketflows/pocketflows-api/revisions/26723490b96f/schema)
