Hog
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET | |
POST | |
POST | |
GET | |
GET | |
GET | |
POST | |
POST | |
GET | |
POST | |
GET | |
PATCH | |
DELETE |
List all environments hog flows
Required API key scopes
hog_flow:readPath parameters
- environment_idstring
Query parameters
- created_atstring
- created_byinteger
- idstring
- limitinteger
- offsetinteger
- updated_atstring
Response
Example request
GET /api /environments /:environment_id /hog_flowsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{environment_id}/hog_flows/".format(project_id=project_id,environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
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","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": null,"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": null,"abort_action": "string","variables": null,"billable_action_types": null}]}
Create environments hog flows
Required API key scopes
hog_flow:writePath parameters
- environment_idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
POST /api /environments /:environment_id /hog_flowsexport 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/environments/:environment_id/hog_flows/\-d actions="array"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{environment_id}/hog_flows/".format(project_id=project_id,environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"actions": "array"}).json()
Example response
Status 201
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Retrieve environments hog flows
Required API key scopes
hog_flow:readPath parameters
- environment_idstring
- idstring
Response
Example request
GET /api /environments /:environment_id /hog_flows /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Update environments hog flows
Required API key scopes
hog_flow:writePath parameters
- environment_idstring
- idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
PATCH /api /environments /:environment_id /hog_flows /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X PATCH \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/\-d name="string"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.patch("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"name": "string"}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Delete environments hog flows
Required API key scopes
hog_flow:writePath parameters
- environment_idstring
- idstring
Example request
DELETE /api /environments /:environment_id /hog_flows /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X DELETE \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.delete("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},)
Example response
Status 204 No response body
Retrieve environments hog flows batch jobs
Path parameters
- environment_idstring
- idstring
Response
Example request
GET /api /environments /:environment_id /hog_flows /:id /batch_jobsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/batch_jobs/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/batch_jobs/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Create environments hog flows batch jobs
Path parameters
- environment_idstring
- idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
POST /api /environments /:environment_id /hog_flows /:id /batch_jobsexport 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/environments/:environment_id/hog_flows/:id/batch_jobs/\-d actions="array"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/batch_jobs/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"actions": "array"}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Create environments hog flows invocations
Path parameters
- environment_idstring
- idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
POST /api /environments /:environment_id /hog_flows /:id /invocationsexport 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/environments/:environment_id/hog_flows/:id/invocations/\-d actions="array"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/invocations/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"actions": "array"}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Retrieve environments hog flows logs
Path parameters
- environment_idstring
- idstring
Example request
GET /api /environments /:environment_id /hog_flows /:id /logsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/logs/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/logs/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Retrieve environments hog flows metrics
Path parameters
- environment_idstring
- idstring
Example request
GET /api /environments /:environment_id /hog_flows /:id /metricsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/metrics/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/metrics/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Retrieve environments hog flows metrics totals
Path parameters
- environment_idstring
- idstring
Example request
GET /api /environments /:environment_id /hog_flows /:id /metrics /totalsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:environment_id/hog_flows/:id/metrics/totals/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{environment_id}/hog_flows/{hog_flow_id}/metrics/totals/".format(project_id=project_id,hog_flow_id="<the hog flow id>",environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Create environments hog flows bulk delete
Path parameters
- environment_idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
POST /api /environments /:environment_id /hog_flows /bulk_deleteexport 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/environments/:environment_id/hog_flows/bulk_delete/\-d actions="array"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{environment_id}/hog_flows/bulk_delete/".format(project_id=project_id,environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"actions": "array"}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Create environments hog flows user blast radius
Path parameters
- environment_idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
POST /api /environments /:environment_id /hog_flows /user_blast_radiusexport 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/environments/:environment_id/hog_flows/user_blast_radius/\-d actions="array"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{environment_id}/hog_flows/user_blast_radius/".format(project_id=project_id,environment_id="<the environment id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"actions": "array"}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
List all hog flows
Required API key scopes
hog_flow:readPath parameters
- project_idstring
Query parameters
- created_atstring
- created_byinteger
- idstring
- limitinteger
- offsetinteger
- updated_atstring
Response
Example request
GET /api /projects /:project_id /hog_flowsexport 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/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/hog_flows/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
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","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": null,"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": null,"abort_action": "string","variables": null,"billable_action_types": null}]}
Create hog flows
Required API key scopes
hog_flow:writePath parameters
- project_idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
POST /api /projects /:project_id /hog_flowsexport 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"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/projects/{project_id}/hog_flows/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={"actions": "array"}).json()
Example response
Status 201
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Retrieve hog flows
Required API key scopes
hog_flow:readPath parameters
- idstring
- project_idstring
Response
Example request
GET /api /projects /:project_id /hog_flows /:idexport 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/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/hog_flows/{hog_flow_id}/".format(project_id=project_id,hog_flow_id="<the hog flow id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Update hog flows
Required API key scopes
hog_flow:writePath parameters
- idstring
- project_idstring
Request parameters
- namestring
- descriptionstring
- status
- trigger
- trigger_masking
- conversion
- exit_condition
- edges
- actionsarray
- variablesarray
Response
Example request
PATCH /api /projects /:project_id /hog_flows /:idexport 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"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.patch("<ph_app_host>/api/projects/{project_id}/hog_flows/{hog_flow_id}/".format(project_id=project_id,hog_flow_id="<the hog flow id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={"name": "string"}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","version": 0,"status": "draft","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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","trigger": null,"trigger_masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"conversion": null,"exit_condition": "exit_on_conversion","edges": null,"actions": [{"id": "string","name": "string","description": "","on_error": "continue","created_at": 0,"updated_at": 0,"filters": {"source": "events","actions": [{"property1": null,"property2": null}],"events": [{"property1": null,"property2": null}],"data_warehouse": [{"property1": null,"property2": null}],"properties": [{"property1": null,"property2": null}],"bytecode": null,"transpiled": null,"filter_test_accounts": true,"bytecode_error": "string"},"type": "string","config": null,"output_variable": null}],"abort_action": "string","variables": [{"property1": "string","property2": "string"}],"billable_action_types": null}
Delete hog flows
Required API key scopes
hog_flow:writePath parameters
- idstring
- project_idstring
Example request
DELETE /api /projects /:project_id /hog_flows /:idexport 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/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.delete("<ph_app_host>/api/projects/{project_id}/hog_flows/{hog_flow_id}/".format(project_id=project_id,hog_flow_id="<the hog flow id>"),headers={"Authorization": "Bearer {}".format(api_key)},)