Hog

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

Endpoints

GET
POST
PATCH
DELETE
POST
GET
POST
POST
GET
GET
GET
GET
POST

List all hog flows schedules

Required API key scopes

hog_flow:read

Path parameters

  • id
    string

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"rrule": "string",
"starts_at": "2019-08-24T14:15:22Z",
"timezone": "string",
"variables": null,
"status": "active",
"next_run_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create hog flows schedules

Required API key scopes

hog_flow:writeperson:read

Path parameters

  • id
    string

Request parameters

  • rrule
    string
  • starts_at
    string
  • timezone
    string
  • variables

Response


Example request

POST /api/projects/:project_id/hog_flows/:id/schedules
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/hog_flows/:id/schedules/\
-d rrule="string",\
-d starts_at="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"rrule": "string",
"starts_at": "2019-08-24T14:15:22Z",
"timezone": "string",
"variables": null,
"status": "active",
"next_run_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Update hog flows schedules

Required API key scopes

hog_flow:write

Path parameters

  • id
    string
  • schedule_id
    string

Request parameters

  • rrule
    string
  • starts_at
    string
  • timezone
    string
  • variables

Response


Example request

PATCH /api/projects/:project_id/hog_flows/:id/schedules/:schedule_id
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/hog_flows/:id/schedules/:schedule_id/\
-d rrule="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"rrule": "string",
"starts_at": "2019-08-24T14:15:22Z",
"timezone": "string",
"variables": null,
"status": "active",
"next_run_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete hog flows schedules

Required API key scopes

hog_flow:write

Path parameters

  • id
    string
  • schedule_id
    string

Example request

DELETE /api/projects/:project_id/hog_flows/:id/schedules/:schedule_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/hog_flows/:id/schedules/:schedule_id/

Example response

Status 204 No response body

Create hog flows apply utm defaults

Required API key scopes

hog_flow:write

Request parameters

  • dry_run
    boolean
    Default: true
  • enable_where_off
    boolean
    Default: false

Response


Example request

POST /api/projects/:project_id/hog_flows/apply_utm_defaults
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/hog_flows/apply_utm_defaults/\
-d dry_run="boolean"

Example response

Status 200
RESPONSE
{
"emails_updated": 0,
"workflows_updated": 0,
"active_workflows_updated": 0,
"emails_turned_on": 0,
"emails_off": 0,
"workflows_without_access": 0,
"workflows_failed": 0
}

Retrieve hog flows broadcast conversion candidates

List the workflows that could become broadcasts: one email to a batch audience, with nothing the broadcast editor would drop. Only workflows the caller may edit are listed.

Required API key scopes

hog_flow:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"has_more": true,
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"status": "draft"
}
]
}

Create hog flows bulk delete

Required API key scopes

hog_flow:write

Request parameters

  • name
    string | null
  • description
    string
    Default:
  • tags
    array
  • status
  • origin_product
  • source_record
    string | null
  • trigger_masking
  • conversion
  • exit_condition
  • email_sending_rate_limit
  • edges
    Click to open
    array
  • actions
    Click to open
    array
  • variables
    array

Response


Example request

POST /api/projects/:project_id/hog_flows/bulk_delete
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/hog_flows/bulk_delete/\
-d actions="array"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "",
"tags": [
"string"
],
"version": 0,
"status": "draft",
"origin_product": "loops",
"source_record": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z",
"trigger": null,
"trigger_masking": {
"ttl": 60,
"threshold": 0,
"hash": "string",
"bytecode": null
},
"conversion": {
"filters": [
{}
],
"events": [
{
"filters": {
"source": "events",
"actions": [
{}
],
"events": [
{}
],
"data_warehouse": [
{}
],
"properties": [
{}
],
"bytecode": null,
"transpiled": null,
"filter_test_accounts": true,
"bytecode_error": "string",
"bytecode_contract": "string"
}
}
],
"window": "string",
"bytecode": null
},
"exit_condition": "exit_on_conversion",
"email_sending_rate_limit": {
"count": 1,
"period": "minute"
},
"edges": [
{
"to": "string",
"type": "continue",
"index": 0,
"from": "string"
}
],
"actions": [
{
"id": "string",
"name": "string",
"description": "",
"on_error": "continue",
"created_at": 0,
"updated_at": 0,
"filters": {
"source": "events",
"actions": [
{}
],
"events": [
{}
],
"data_warehouse": [
{}
],
"properties": [
{}
],
"bytecode": null,
"transpiled": null,
"filter_test_accounts": true,
"bytecode_error": "string",
"bytecode_contract": "string"
},
"type": "trigger",
"config": {},
"output_variable": null
}
],
"abort_action": "string",
"variables": [
{
"property1": "string",
"property2": "string"
}
],
"billable_action_types": null,
"schedules": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"rrule": "string",
"starts_at": "2019-08-24T14:15:22Z",
"timezone": "string",
"variables": null,
"status": "active",
"next_run_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"user_access_level": "string",
"draft": null,
"draft_updated_at": "2019-08-24T14:15:22Z",
"action_redirects": {
"property1": "string",
"property2": "string"
},
"email_sending_paused_at": "2019-08-24T14:15:22Z",
"email_sending_paused_reason": "string",
"email_sending_paused_by": "string",
"email_sending_pause_requires_support": true,
"email_sending_resumed_at": "2019-08-24T14:15:22Z",
"last_run": {
"task_id": "736fde4d-9029-4915-8189-01353d6982cb",
"status": "string",
"ran_at": "2019-08-24T14:15:22Z"
},
"warnings": [
{
"code": "test_sender_live",
"message": "string"
}
]
}

Create hog flows bulk update tags

Bulk update tags on multiple objects.

PAT access: this action has no required_scopes= on the decorator — inheriting viewsets must add "bulk_update_tags" to their scope_object_write_actions list to accept personal API keys. Without that opt-in, APIScopePermission rejects PAT requests with "This action does not support personal API key access". Done per-viewset so granting <scope>:write for one resource doesn't leak access to sibling resources that share this mixin.

Accepts:

  • {"ids": [...], "action": "add"|"remove"|"set", "tags": ["tag1", "tag2"]}

Actions:

  • "add": Add tags to existing tags on each object
  • "remove": Remove specific tags from each object
  • "set": Replace all tags on each object with the provided list

Required API key scopes

hog_flow:write

Request parameters

  • ids
    array
  • action
  • tags
    array

Response


Example request

POST /api/projects/:project_id/hog_flows/bulk_update_tags
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/hog_flows/bulk_update_tags/\
-d ids="array",\
-d action=undefined,\
-d tags="array"

Example response

Status 200
RESPONSE
{
"updated": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"tags": [
"string"
]
}
],
"skipped": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"reason": "string"
}
]
}

Retrieve hog flows email sending suspension

Cheap read for the scene-wide suspension banner: single-row TeamWorkflowsConfig lookup with no reputation computation. Every project member sees this — a suspension stops everyone's email, so hiding it would leave silent send failures unexplained.

Required API key scopes

hog_flow:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"email_sending_suspended": true,
"email_sending_suspended_at": "2019-08-24T14:15:22Z",
"email_sending_suspension_reason": "string"
}

Retrieve hog flows metrics global

Required API key scopes

hog_flow:read

Query parameters

  • after
    string
    Default: -7d
  • before
    string

Example request

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

Example response

Status 200
RESPONSE
{
"workflow_id": "string",
"succeeded": 0,
"failed": 0
}

Retrieve hog flows reputation

Bounce/complaint rates for this project's workflow email over the last 30 days, computed on the fly from app metrics (a project-wide aggregate plus per-workflow rows, worst first, capped), together with the authoritative AWS SES tenant verdict — sending status and open reputation findings. Our rates are the per-workflow diagnosis; AWS judges and enforces.

Required API key scopes

hog_flow:read

Query parameters

  • search
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"aws": {
"health": "healthy",
"sending_status": "ENABLED",
"findings": [
{
"finding_type": "DKIM",
"impact": "LOW",
"description": "string",
"last_updated_at": "2019-08-24T14:15:22Z"
}
]
},
"reputation": {
"bounce_rate": 0.1,
"complaint_rate": 0.1,
"emails_sent": 0
},
"workflows": [
{
"bounce_rate": 0.1,
"complaint_rate": 0.1,
"emails_sent": 0,
"hog_flow_id": "07371c7a-9bb6-4ac0-aeea-5616bed86938",
"hog_flow_name": "string",
"email_sending_paused": true,
"email_sending_paused_at": "2019-08-24T14:15:22Z",
"email_sending_paused_reason": "string"
}
],
"isps": [
{
"isp": "string",
"emails_sent": 0,
"delivery_rate": 0,
"bounce_rate": 0,
"transient_bounce_rate": 0,
"complaint_rate": 0,
"complaint_base": 0,
"unavailable": [
"string"
]
}
],
"isp_shared_domains": [
"string"
],
"isp_withheld_domains": [
"string"
],
"email_sending_suspended": true,
"email_sending_suspended_at": "2019-08-24T14:15:22Z",
"email_sending_suspension_reason": "string",
"sending_allowance": {
"tier": 0,
"max_tier": 0,
"emails_per_day": 0,
"max_batch_audience": 0,
"emails_sent_last_day": 0,
"enforced": true,
"rate_limited_max_batch_audience": 0
},
"infrastructure": {
"emails_sent_at_least": 0,
"delivery_rate": 0.1,
"bounce_rate": 0.1,
"complaint_rate": 0.1
}
}

Retrieve hog flows send calendar

Active batch and schedule workflows with an email step that is not transactional, and that have a schedule with sends to come or a batch run inside the range. Each carries only the fields a calendar card shows. Read a single workflow for its full configuration.

Required API key scopes

hog_flow:read

Query parameters

  • end
    string
  • ids
    string
  • start
    string

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"origin_product": "loops",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"user_access_level": "string",
"trigger_type": "string",
"audience_properties": [
{}
],
"audience_type": "string",
"email_to": "string",
"message_category_id": "string",
"schedules": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"rrule": "string",
"starts_at": "2019-08-24T14:15:22Z",
"timezone": "string",
"variables": null,
"status": "active",
"next_run_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"batch_jobs": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "waiting",
"created_at": "2019-08-24T14:15:22Z"
}
]
}

Create hog flows user blast radius

Required API key scopes

hog_flow:readperson:read

Request parameters

  • filters
    object
  • group_type_index
    integer | null
  • dedupe_key
  • sends_email
    boolean
    Default: true
  • email_sending_rate_limit
  • refresh
    boolean
    Default: false

Response


Example request

POST /api/projects/:project_id/hog_flows/user_blast_radius
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/hog_flows/user_blast_radius/\
-d filters="object"

Example response

Status 200
RESPONSE
{
"affected": 0,
"total": 0,
"limit": 0,
"dedupe_key": "email",
"confirm_token": "string",
"realtime_cohort": {
"id": 0,
"name": "string",
"state": "ready",
"percent_complete": 0
},
"realtime_cohort_with_other_conditions": {
"id": 0,
"name": "string"
},
"rate_limited": {
"max_emails_per_hour": 0,
"max_days": 0,
"limit": 0
}
}