Hog

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

Endpoints

GET
POST
GET
PATCH
DELETE
PATCH
GET
GET
GET
POST
POST
POST
POST
PATCH
GET
GET
GET
GET
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"
  • 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
}
]
}

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
  • 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",
"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"
}
}

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",
"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"
}
}

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"
}
}

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

Update hog flows actions email

Required API key scopes

hog_flow:write

Path parameters

  • action_id
    string
  • id
    string

Request parameters

  • base_updated_at
    string
  • operations
    Click to open
    array
  • email_patch

Response


Example request

PATCH /api/projects/:project_id/hog_flows/:id/actions/:action_id/email
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/actions/:action_id/email/\
-d base_updated_at="string"

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"
}
}

Retrieve hog flows assets

Required API key scopes

hog_flow:readperson:read

Path parameters

  • id
    string

Query parameters

  • action_id
    string
  • after
    string
    Default: -30d
  • before
    string
  • distinct_id
    string
  • invocation_id
    string
  • limit
    integer
    Default: 50
  • offset
    integer
    Default: 0
  • parent_run_id
    string
  • search
    string

Example request

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

Example response

Status 200
RESPONSE
{
"invocation_id": "string",
"action_id": "string",
"function_id": "string",
"function_name": "string",
"parent_run_id": "string",
"kind": "string",
"distinct_id": "string",
"person_id": "string",
"recipient": "string",
"subject": "string",
"status": "string",
"sent_at": "2019-08-24T14:15:22Z"
}

Retrieve hog flows asset content

Required API key scopes

hog_flow:readperson:read

Path parameters

  • id
    string

Query parameters

  • action_id
    string
    Default:
  • invocation_id
    string

Example request

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

Example response

Status 200

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
}

Create hog flows convert to

Move a workflow to broadcasts. It keeps its id, runs and metrics, leaves the workflows list and opens in the broadcast editor. This cannot be undone.

Required API key scopes

hog_flow:write

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"origin_product": "loops"
}

Create hog flows discard draft

Required API key scopes

hog_flow:write

Path parameters

  • id
    string

Response


Example request

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

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"
}
}

Update hog flows graph

Required API key scopes

hog_flow:write

Path parameters

  • id
    string

Request parameters

  • base_updated_at
    string
  • operations
    Click to open
    array

Response


Example request

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

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"
}
}

Retrieve hog flows in flight

Required API key scopes

hog_flow:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 0,
"by_action": {
"property1": 0,
"property2": 0
},
"position_unknown": 0
}

Retrieve hog flows invocation results

Required API key scopes

hog_flow:readperson:read

Path parameters

  • id
    string

Query parameters

  • after
    string
    Default: -7d
  • before
    string
  • distinct_id
    string
  • error_message_contains
    string
  • limit
    integer
    Default: 50
  • status
    string

Example request

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

Example response

Status 200
RESPONSE
{
"invocation_id": "string",
"status": "string",
"error_kind": "string",
"error_message": "string",
"distinct_id": "string",
"person_id": "string",
"scheduled_at": "2019-08-24T14:15:22Z",
"started_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"duration_ms": 0,
"attempts": 0,
"is_retry": true
}

Retrieve hog flows invocation result

Required API key scopes

hog_flow:readperson:read

Path parameters

  • id
    string
  • invocation_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"invocation_globals": {},
"invocation_id": "string",
"status": "string",
"error_kind": "string",
"error_message": "string",
"distinct_id": "string",
"person_id": "string",
"scheduled_at": "2019-08-24T14:15:22Z",
"started_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"duration_ms": 0,
"attempts": 0,
"is_retry": true
}

Retrieve hog flows invocation results count

Count invocations matching the same filters as the list endpoint, without its 500-row cap.

Required API key scopes

hog_flow:readperson:read

Path parameters

  • id
    string

Query parameters

  • after
    string
    Default: -7d
  • before
    string
  • distinct_id
    string
  • error_message_contains
    string
  • status
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 0
}

Create hog flows invocations

Required API key scopes

hog_flow:writegroup:read

Path parameters

  • id
    string

Request parameters

  • configuration
  • globals
    object
  • mock_async_functions
    boolean
    Default: true
  • current_action_id
    string
  • use_draft
    boolean
    Default: false

Example request

POST /api/projects/:project_id/hog_flows/:id/invocations
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/invocations/\
-d configuration=undefined

Example response

Status 200 No response body