Skip to main content
POST
/
triggers
/
{id}
Update a trigger
curl --request POST \
  --url https://api.pocketflows.com/triggers/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_defined_event": "<string>",
  "name": "<string>",
  "email_address": "<string>",
  "phone_number": "<string>",
  "excluded_customers": [
    "<string>"
  ],
  "metadata": {},
  "attributed_revenue": 123,
  "steps": [
    {
      "type": "email",
      "email_template_id": "<string>",
      "custom_step_id": "<string>"
    }
  ]
}
'
{
  "id": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "name": "<string>",
  "project_defined_event": "<string>",
  "internal_event_definition": {
    "type": "customer_created",
    "segment": "<string>"
  },
  "steps": [
    {
      "type": "email",
      "email_template_id": "<string>",
      "custom_step_id": "<string>"
    }
  ],
  "status": "draft",
  "filter": "<string>",
  "email_address": "<string>",
  "phone_number": "<string>",
  "attributed_revenue": 123,
  "metadata": {},
  "statistics": {
    "emails": {
      "sent": 123,
      "delivered": 123,
      "opened": 123,
      "soft_bounced": 123,
      "hard_bounced": 123,
      "clicked": 123
    },
    "custom_steps": [
      {
        "custom_step": "<string>",
        "sent": 123
      }
    ],
    "executions": {
      "total": 123,
      "pending": 123,
      "started": 123,
      "finished": 123,
      "errored": 123
    },
    "sms": {
      "sms_sent_count": 123,
      "sms_sent_segments_count": 123,
      "mms_sent_count": 123,
      "mms_sent_segments_count": 123
    },
    "total_customers_enrolled": 123,
    "total_customers_started": 123,
    "total_customers_finished": 123
  },
  "trigger": "<string>"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

The ID of the trigger

Body

application/json
project_defined_event
string
required

The ID of a project defined event

name
string

The name of the trigger

email_address
string | null

The ID of an email address or project email address. Will be used to send emails as part of this trigger

phone_number
string | null

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

Metadata for the trigger

attributed_revenue
number | null

The revenue attributed to the trigger

steps
object[]

The steps of the trigger

Response

200 - application/json

The updated Trigger object

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 | null
required

The ID of the project-defined event that triggers the trigger

internal_event_definition
object
required

The internal event definition that triggers the trigger

steps
object[]
required

The steps of the trigger

status
enum<string>
required

The status of the trigger. One of "draft", "active", or "inactive"

Available options:
draft,
active,
inactive
filter
string | null
required

An additional filter that determines if the trigger should be run

email_address
string | null
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 | null
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
required

The revenue attributed to the trigger

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

trigger
string | null

Deprecated. Will always be null