Broadcasts

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

Endpoints

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

List all hog flows

Required API key scopes

hog_flow:read

Query parameters

  • broadcast_eligible
    boolean
  • broadcast_status
    string
  • created_at
    string
  • created_by
    string
  • id
    string
  • latest_send_first
    boolean
  • limit
    integer
  • name
    string
  • offset
    integer
  • optimization_enabled
    boolean
  • origin_product
    string
    One of: "broadcasts""loops""transactional_emails""transactional_push"
  • search
    string
  • source_record
    string
  • status
    string
    One of: "active""archived""draft"
  • tags
    string
  • trigger
    string
  • type
    string
  • updated_at
    string

Response


Example request

GET /api/projects/:project_id/hog_flows
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/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"tags": [
"string"
],
"version": 0,
"status": "draft",
"origin_product": "loops",
"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": null,
"conversion": null,
"exit_condition": "exit_on_conversion",
"email_sending_rate_limit": null,
"edges": null,
"actions": null,
"draft": null,
"abort_action": "string",
"variables": null,
"billable_action_types": null,
"user_access_level": "string",
"last_run": {
"task_id": "736fde4d-9029-4915-8189-01353d6982cb",
"status": "string",
"ran_at": "2019-08-24T14:15:22Z"
},
"pending_suggestions": 0,
"suggestions_enabled": true,
"warnings": [
{
"code": "test_sender_live",
"message": "string"
}
]
}
]
}

Create hog flows

Required API key scopes

hog_flow:write

Request parameters

  • name
    string | null
  • description
    string
    Default:
  • tags
    array
  • status
  • origin_product
  • source_record
    string | null
  • entry_attempt_id
    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
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/\
-d actions="array"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "",
"tags": [
"string"
],
"version": 0,
"status": "draft",
"origin_product": "loops",
"source_record": "string",
"entry_attempt_id": "2302cddb-15e0-437d-82e0-f4bc727286a9",
"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"
}
]
}

Retrieve hog flows

Required API key scopes

hog_flow:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/hog_flows/:id
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/

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",
"entry_attempt_id": "2302cddb-15e0-437d-82e0-f4bc727286a9",
"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"
}
]
}

Update hog flows

Required API key scopes

hog_flow:write

Path parameters

  • id
    string

Request parameters

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

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "",
"tags": [
"string"
],
"version": 0,
"status": "draft",
"origin_product": "loops",
"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"
}
]
}

Delete hog flows

Required API key scopes

hog_flow:write

Path parameters

  • id
    string

Example request

DELETE /api/projects/:project_id/hog_flows/: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/

Example response

Status 204 No response body

List all hog flows batch jobs

Required API key scopes

hog_flow:read

Path parameters

  • id
    string

Example request

GET /api/projects/:project_id/hog_flows/:id/batch_jobs
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/batch_jobs/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "waiting",
"hog_flow": "a358a3bf-876e-4745-ab24-d5d741b3cd17",
"filters": null,
"variables": null,
"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"
}

Create hog flows batch jobs

Required API key scopes

hog_flow:writeperson:read

Path parameters

  • id
    string

Request parameters

  • status
  • hog_flow
    string
  • variables

Response


Example request

POST /api/projects/:project_id/hog_flows/:id/batch_jobs
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/batch_jobs/\
-d hog_flow="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "waiting",
"hog_flow": "a358a3bf-876e-4745-ab24-d5d741b3cd17",
"filters": null,
"variables": null,
"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"
}

Create hog flows batch jobs cancel

Stop a batch run: no more of its audience is enrolled, and every run of it still in flight is canceled.

Stopping is asynchronous: runs are flagged here, then terminated by the workflow workers. Steps that already executed, like sent messages, are not undone. Already-finished batch runs are left untouched.

Required API key scopes

hog_flow:write

Path parameters

  • batch_job_id
    string
  • id
    string

Response


Example request

POST /api/projects/:project_id/hog_flows/:id/batch_jobs/:batch_job_id/cancel
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/batch_jobs/:batch_job_id/cancel/

Example response

Status 200
RESPONSE
{
"status": "waiting",
"marked": 0,
"remaining": 0,
"done": true
}

Retrieve hog flows metrics

Also available via the PostHog MCP server:

  • workflows-stats — Get workflow stats

Required API key scopes

hog_flow:read

Path parameters

  • id
    string

Query parameters

  • after
    string
    Default: -7d
  • before
    string
  • breakdown_by
    string
    Default: kind
    One of: "name""kind"
  • instance_id
    string
  • interval
    string
    Default: day
    One of: "hour""day""week"
  • kind
    string
  • name
    string

Response


Example request

GET /api/projects/:project_id/hog_flows/:id/metrics
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/metrics/

Example response

Status 200
RESPONSE
{
"labels": [
"string"
],
"series": [
{
"name": "string",
"values": [
0
]
}
]
}

Create hog flows publish

Required API key scopes

hog_flow:write

Path parameters

  • id
    string

Request parameters

  • confirm
    boolean
    Default: false
  • confirm_token
    string
  • sandbox_sender_warned
    boolean | null

Response


Example request

POST /api/projects/:project_id/hog_flows/:id/publish
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/publish/\
-d confirm="boolean"

Example response

Status 200
RESPONSE
{
"published": true,
"in_flight_runs": 0,
"draft_updated_at": "2019-08-24T14:15:22Z",
"confirm_token": "string",
"impact": {
"deleted_steps": [
{
"action_id": "string",
"name": "string",
"runs": 0,
"moves_to": {
"action_id": "string",
"name": "string"
},
"exits": true
}
],
"position_unknown": 0,
"empty_variables": [
{
"variable": "string",
"set_by": "string",
"referenced_by": [
"string"
]
}
],
"schedule_conflicts": [
{
"schedule_id": "string",
"variables": [
"string"
]
}
]
},
"moves_to_sandbox_sender": true,
"workflow": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "",
"tags": [
"string"
],
"version": 0,
"status": "draft",
"origin_product": "loops",
"source_record": "string",
"entry_attempt_id": "2302cddb-15e0-437d-82e0-f4bc727286a9",
"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"
}
]
}
}

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 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
},
"skipped_test_account_filters": [
"string"
]
}