Workflow Sending

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
PATCH

Retrieve workflow sending rules

The project-wide rules every workflow and broadcast follows when it sends a message.

Required API key scopes

project:read

Response


Example request

GET /api/projects/:project_id/workflow_sending_rules/current
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/workflow_sending_rules/current/

Example response

Status 200
RESPONSE
{
"project_id": 0,
"expected_project_id": 0,
"marketing_frequency_cap_max_messages": 1,
"marketing_frequency_cap_window_days": 1,
"marketing_frequency_cap_hold_hours": 1,
"email_tracking_consent_mode": "off",
"capture_workflows_engagement_events": true
}

Update workflow sending rules

The project-wide rules every workflow and broadcast follows when it sends a message.

Required API key scopes

project:write

Request parameters

  • expected_project_id
    integer
  • marketing_frequency_cap_max_messages
    integer | null
  • marketing_frequency_cap_window_days
    integer | null
  • marketing_frequency_cap_hold_hours
    integer | null
  • email_tracking_consent_mode
  • capture_workflows_engagement_events
    boolean

Response


Example request

PATCH /api/projects/:project_id/workflow_sending_rules/current
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/workflow_sending_rules/current/\
-d project_id="integer"

Example response

Status 200
RESPONSE
{
"project_id": 0,
"expected_project_id": 0,
"marketing_frequency_cap_max_messages": 1,
"marketing_frequency_cap_window_days": 1,
"marketing_frequency_cap_hold_hours": 1,
"email_tracking_consent_mode": "off",
"capture_workflows_engagement_events": true
}