Environments-17
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
POST | |
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
POST |
Retrieve environments groups property values
Required API key scopes
group:readPath parameters
- project_idstring
Example request
GET /api /environments /:project_id /groups /property_valuesexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/groups/property_values/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/groups/property_values/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Retrieve environments groups property values
Required API key scopes
group:readPath parameters
- project_idstring
Example request
GET /api /environments /:project_id /groups /property_valuesexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/groups/property_values/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/groups/property_values/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Retrieve environments groups related
Required API key scopes
group:readPath parameters
- project_idstring
Query parameters
- group_type_indexinteger
- idstring
Example request
GET /api /environments /:project_id /groups /relatedexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/groups/related/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/groups/related/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Retrieve environments groups related
Required API key scopes
group:readPath parameters
- project_idstring
Query parameters
- group_type_indexinteger
- idstring
Example request
GET /api /environments /:project_id /groups /relatedexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/groups/related/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/groups/related/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200 No response body
Create environments groups update property
Required API key scopes
group:writePath parameters
- project_idstring
Query parameters
- group_keystring
- group_type_indexinteger
Request parameters
- group_type_indexinteger
- group_keystring
- group_properties
Example request
POST /api /environments /:project_id /groups /update_propertyexport 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/:project_id/groups/update_property/\-d group_type_index="integer",\-d group_key="string"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{project_id}/groups/update_property/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={"group_type_index": "integer","group_key": "string"}).json()
Example response
Status 200 No response body
Create environments groups update property
Required API key scopes
group:writePath parameters
- project_idstring
Query parameters
- group_keystring
- group_type_indexinteger
Request parameters
- group_type_indexinteger
- group_keystring
- group_properties
Example request
POST /api /environments /:project_id /groups /update_propertyexport 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/:project_id/groups/update_property/\-d group_type_index="integer",\-d group_key="string"
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{project_id}/groups/update_property/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={"group_type_index": "integer","group_key": "string"}).json()
Example response
Status 200 No response body
List all environments hog functions
Required API key scopes
hog_function:readPath parameters
- project_idstring
Query parameters
- created_atstring
- created_byinteger
- enabledboolean
- idstring
- limitinteger
- offsetinteger
- searchstring
- typearray
- updated_atstring
Response
Example request
GET /api /environments /:project_id /hog_functionsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/hog_functions/".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","type": "string","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"hog": "string","filters": null,"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"status": {"state": 0,"tokens": 0},"execution_order": 0}]}
List all environments hog functions
Required API key scopes
hog_function:readPath parameters
- project_idstring
Query parameters
- created_atstring
- created_byinteger
- enabledboolean
- idstring
- limitinteger
- offsetinteger
- searchstring
- typearray
- updated_atstring
Response
Example request
GET /api /environments /:project_id /hog_functionsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/hog_functions/".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","type": "string","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"hog": "string","filters": null,"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"status": {"state": 0,"tokens": 0},"execution_order": 0}]}
Create environments hog functions
Required API key scopes
hog_function:writePath parameters
- project_idstring
Request parameters
- type
- namestring
- descriptionstring
- enabledboolean
- deletedboolean
- hogstring
- inputs_schemaarray
- inputsobject
- filters
- masking
- mappingsarray
- icon_urlstring
- template_idstring
- execution_orderinteger
- _create_in_folderstring
Response
Example request
POST /api /environments /:project_id /hog_functionsexport 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/:project_id/hog_functions/\-d type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{project_id}/hog_functions/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={}).json()
Example response
Status 201
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","type": "destination","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"deleted": true,"hog": "string","bytecode": null,"transpiled": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"},"masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"mappings": [{"name": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"}}],"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"template_id": "string","status": {"state": 0,"tokens": 0},"execution_order": 32767,"_create_in_folder": "string","batch_export_id": "b64664c0-dba6-4c8b-9083-fa5e13aac47d"}
Create environments hog functions
Required API key scopes
hog_function:writePath parameters
- project_idstring
Request parameters
- type
- namestring
- descriptionstring
- enabledboolean
- deletedboolean
- hogstring
- inputs_schemaarray
- inputsobject
- filters
- masking
- mappingsarray
- icon_urlstring
- template_idstring
- execution_orderinteger
- _create_in_folderstring
Response
Example request
POST /api /environments /:project_id /hog_functionsexport 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/:project_id/hog_functions/\-d type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{project_id}/hog_functions/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={}).json()
Example response
Status 201
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","type": "destination","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"deleted": true,"hog": "string","bytecode": null,"transpiled": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"},"masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"mappings": [{"name": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"}}],"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"template_id": "string","status": {"state": 0,"tokens": 0},"execution_order": 32767,"_create_in_folder": "string","batch_export_id": "b64664c0-dba6-4c8b-9083-fa5e13aac47d"}
Retrieve environments hog functions
Required API key scopes
hog_function:readPath parameters
- idstring
- project_idstring
Response
Example request
GET /api /environments /:project_id /hog_functions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","type": "destination","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"deleted": true,"hog": "string","bytecode": null,"transpiled": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"},"masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"mappings": [{"name": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"}}],"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"template_id": "string","status": {"state": 0,"tokens": 0},"execution_order": 32767,"_create_in_folder": "string","batch_export_id": "b64664c0-dba6-4c8b-9083-fa5e13aac47d"}
Retrieve environments hog functions
Required API key scopes
hog_function:readPath parameters
- idstring
- project_idstring
Response
Example request
GET /api /environments /:project_id /hog_functions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","type": "destination","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"deleted": true,"hog": "string","bytecode": null,"transpiled": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"},"masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"mappings": [{"name": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"}}],"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"template_id": "string","status": {"state": 0,"tokens": 0},"execution_order": 32767,"_create_in_folder": "string","batch_export_id": "b64664c0-dba6-4c8b-9083-fa5e13aac47d"}
Update environments hog functions
Required API key scopes
hog_function:writePath parameters
- idstring
- project_idstring
Request parameters
- type
- namestring
- descriptionstring
- enabledboolean
- deletedboolean
- hogstring
- inputs_schemaarray
- inputsobject
- filters
- masking
- mappingsarray
- icon_urlstring
- template_idstring
- execution_orderinteger
- _create_in_folderstring
Response
Example request
PATCH /api /environments /:project_id /hog_functions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X PATCH \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/:id/\-d type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.patch("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","type": "destination","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"deleted": true,"hog": "string","bytecode": null,"transpiled": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"},"masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"mappings": [{"name": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"}}],"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"template_id": "string","status": {"state": 0,"tokens": 0},"execution_order": 32767,"_create_in_folder": "string","batch_export_id": "b64664c0-dba6-4c8b-9083-fa5e13aac47d"}
Update environments hog functions
Required API key scopes
hog_function:writePath parameters
- idstring
- project_idstring
Request parameters
- type
- namestring
- descriptionstring
- enabledboolean
- deletedboolean
- hogstring
- inputs_schemaarray
- inputsobject
- filters
- masking
- mappingsarray
- icon_urlstring
- template_idstring
- execution_orderinteger
- _create_in_folderstring
Response
Example request
PATCH /api /environments /:project_id /hog_functions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X PATCH \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/:id/\-d type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.patch("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={}).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","type": "destination","name": "string","description": "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": {"property1": null,"property2": null},"role_at_organization": "engineering"},"updated_at": "2019-08-24T14:15:22Z","enabled": true,"deleted": true,"hog": "string","bytecode": null,"transpiled": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"},"masking": {"ttl": 60,"threshold": 0,"hash": "string","bytecode": null},"mappings": [{"name": "string","inputs_schema": [{"type": "string","key": "string","label": "string","choices": [{"property1": null,"property2": null}],"required": false,"default": null,"secret": false,"hidden": false,"description": "string","integration": "string","integration_key": "string","requires_field": "string","integration_field": "string","requiredScopes": "string","templating": true}],"inputs": {"property1": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null},"property2": {"value": "string","templating": "hog","bytecode": [null],"order": 0,"transpiled": null}},"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"}}],"icon_url": "string","template": {"id": "string","name": "string","description": "string","code": "string","code_language": "string","inputs_schema": null,"type": "string","status": "string","category": null,"free": true,"icon_url": "string","filters": null,"masking": null,"mapping_templates": [{"name": "string","include_by_default": true,"filters": null,"inputs": null,"inputs_schema": null}]},"template_id": "string","status": {"state": 0,"tokens": 0},"execution_order": 32767,"_create_in_folder": "string","batch_export_id": "b64664c0-dba6-4c8b-9083-fa5e13aac47d"}
Delete environments hog functions
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
hog_function:writePath parameters
- idstring
- project_idstring
Example request
DELETE /api /environments /:project_id /hog_functions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X DELETE \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.delete("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},)
Example response
Status 405 No response body
Delete environments hog functions
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
hog_function:writePath parameters
- idstring
- project_idstring
Example request
DELETE /api /environments /:project_id /hog_functions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X DELETE \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/environments/:project_id/hog_functions/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.delete("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},)
Example response
Status 405 No response body
Create environments hog functions enable backfills
Path parameters
- idstring
- project_idstring
Request parameters
- type
- namestring
- descriptionstring
- enabledboolean
- deletedboolean
- hogstring
- inputs_schemaarray
- inputsobject
- filters
- masking
- mappingsarray
- icon_urlstring
- template_idstring
- execution_orderinteger
- _create_in_folderstring
Example request
POST /api /environments /:project_id /hog_functions /:id /enable_backfillsexport 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/:project_id/hog_functions/:id/enable_backfills/\-d type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/enable_backfills/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={}).json()
Example response
Status 200 No response body
Create environments hog functions enable backfills
Path parameters
- idstring
- project_idstring
Request parameters
- type
- namestring
- descriptionstring
- enabledboolean
- deletedboolean
- hogstring
- inputs_schemaarray
- inputsobject
- filters
- masking
- mappingsarray
- icon_urlstring
- template_idstring
- execution_orderinteger
- _create_in_folderstring
Example request
POST /api /environments /:project_id /hog_functions /:id /enable_backfillsexport 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/:project_id/hog_functions/:id/enable_backfills/\-d type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/environments/{project_id}/hog_functions/{environments-17_id}/enable_backfills/".format(project_id=project_id,environments-17_id="<the environments-17 id>"),headers={"Authorization": "Bearer {}".format(api_key)},data={}).json()