Custom Property
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET |
List all custom property definitions
Required API key scopes
account:readQuery parameters
- limitinteger
- offsetinteger
- paginationstringOne of:
"none"
Response
Example request
GET /api /projects /:project_id /custom_property_definitionsexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/custom_property_definitions/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/custom_property_definitions/".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","display_type": "text","target_type": "account","group_type_index": 4,"is_big_number": false,"is_canonical": true,"options": [{"id": "string","label": "string","color": "preset-1"}],"source": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58","saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc","external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98","source_column": "string","column_property_map": null,"column_descriptions": null,"key_column": "string","is_enabled": true,"consecutive_failures": 0,"last_synced_at": "2019-08-24T14:15:22Z","last_sync_error": "string","created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","sync_frequency_interval_seconds": 0,"next_sync_at": "2019-08-24T14:15:22Z","latest_run": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","job_id": "string","account_segment": "tracked","sync_phase": "staging","attempt": 0,"workflow_id": "string","workflow_run_id": "5e5ef678-2347-491b-a579-798b0d4ed952","temporal_url": "http://example.com","trigger": "string","status": "string","started_at": "2019-08-24T14:15:22Z","finished_at": "2019-08-24T14:15:22Z","rows_read": 0,"changed": 0,"existing": 0,"produced": 0,"skipped_missing_person": 0,"error": "string","created_at": "2019-08-24T14:15:22Z"},"external_data_source": "8df47340-930c-47e2-b1d9-b1b8d55c351d","table_name": "string","saved_query_name": "string"},"created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","references": [{"id": "string","name": "string","status": "string","type": "string"}],"has_workflow_reference": true}]}
Create custom property definitions
Required API key scopes
account:writeRequest parameters
- namestring
- descriptionstring | null
- display_type
- target_typeDefault:
account - group_type_indexinteger | null
- is_big_numberbooleanDefault:
false - optionsarray | null
Response
Example request
POST /api /projects /:project_id /custom_property_definitionsexport 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/custom_property_definitions/\-d name="string",\-d display_type=undefined
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.post("<ph_app_host>/api/projects/{project_id}/custom_property_definitions/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={"name": "string"}).json()
Example response
Status 201
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","display_type": "text","target_type": "account","group_type_index": 4,"is_big_number": false,"is_canonical": true,"options": [{"id": "string","label": "string","color": "preset-1"}],"source": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58","saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc","external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98","source_column": "string","column_property_map": null,"column_descriptions": null,"key_column": "string","is_enabled": true,"consecutive_failures": 0,"last_synced_at": "2019-08-24T14:15:22Z","last_sync_error": "string","created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","sync_frequency_interval_seconds": 0,"next_sync_at": "2019-08-24T14:15:22Z","latest_run": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","job_id": "string","account_segment": "tracked","sync_phase": "staging","attempt": 0,"workflow_id": "string","workflow_run_id": "5e5ef678-2347-491b-a579-798b0d4ed952","temporal_url": "http://example.com","trigger": "string","status": "string","started_at": "2019-08-24T14:15:22Z","finished_at": "2019-08-24T14:15:22Z","rows_read": 0,"changed": 0,"existing": 0,"produced": 0,"skipped_missing_person": 0,"error": "string","created_at": "2019-08-24T14:15:22Z"},"external_data_source": "8df47340-930c-47e2-b1d9-b1b8d55c351d","table_name": "string","saved_query_name": "string"},"created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","references": [{"id": "string","name": "string","status": "string","type": "string"}],"has_workflow_reference": true}
Retrieve custom property definitions
Required API key scopes
account:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /custom_property_definitions /:idexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/custom_property_definitions/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/custom_property_definitions/{custom_property_definition_id}/".format(project_id=project_id,custom_property_definition_id="<the custom property definition id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","display_type": "text","target_type": "account","group_type_index": 4,"is_big_number": false,"is_canonical": true,"options": [{"id": "string","label": "string","color": "preset-1"}],"source": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58","saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc","external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98","source_column": "string","column_property_map": null,"column_descriptions": null,"key_column": "string","is_enabled": true,"consecutive_failures": 0,"last_synced_at": "2019-08-24T14:15:22Z","last_sync_error": "string","created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","sync_frequency_interval_seconds": 0,"next_sync_at": "2019-08-24T14:15:22Z","latest_run": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","job_id": "string","account_segment": "tracked","sync_phase": "staging","attempt": 0,"workflow_id": "string","workflow_run_id": "5e5ef678-2347-491b-a579-798b0d4ed952","temporal_url": "http://example.com","trigger": "string","status": "string","started_at": "2019-08-24T14:15:22Z","finished_at": "2019-08-24T14:15:22Z","rows_read": 0,"changed": 0,"existing": 0,"produced": 0,"skipped_missing_person": 0,"error": "string","created_at": "2019-08-24T14:15:22Z"},"external_data_source": "8df47340-930c-47e2-b1d9-b1b8d55c351d","table_name": "string","saved_query_name": "string"},"created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","references": [{"id": "string","name": "string","status": "string","type": "string"}],"has_workflow_reference": true}
Update custom property definitions
Required API key scopes
account:writePath parameters
- idstring
Request parameters
- namestring
- descriptionstring | null
- display_type
- target_typeDefault:
account - group_type_indexinteger | null
- is_big_numberbooleanDefault:
false - optionsarray | null
Response
Example request
PATCH /api /projects /:project_id /custom_property_definitions /: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/custom_property_definitions/: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}/custom_property_definitions/{custom_property_definition_id}/".format(project_id=project_id,custom_property_definition_id="<the custom property definition 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","display_type": "text","target_type": "account","group_type_index": 4,"is_big_number": false,"is_canonical": true,"options": [{"id": "string","label": "string","color": "preset-1"}],"source": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58","saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc","external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98","source_column": "string","column_property_map": null,"column_descriptions": null,"key_column": "string","is_enabled": true,"consecutive_failures": 0,"last_synced_at": "2019-08-24T14:15:22Z","last_sync_error": "string","created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","sync_frequency_interval_seconds": 0,"next_sync_at": "2019-08-24T14:15:22Z","latest_run": {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","job_id": "string","account_segment": "tracked","sync_phase": "staging","attempt": 0,"workflow_id": "string","workflow_run_id": "5e5ef678-2347-491b-a579-798b0d4ed952","temporal_url": "http://example.com","trigger": "string","status": "string","started_at": "2019-08-24T14:15:22Z","finished_at": "2019-08-24T14:15:22Z","rows_read": 0,"changed": 0,"existing": 0,"produced": 0,"skipped_missing_person": 0,"error": "string","created_at": "2019-08-24T14:15:22Z"},"external_data_source": "8df47340-930c-47e2-b1d9-b1b8d55c351d","table_name": "string","saved_query_name": "string"},"created_at": "2019-08-24T14:15:22Z","created_by": 0,"updated_at": "2019-08-24T14:15:22Z","references": [{"id": "string","name": "string","status": "string","type": "string"}],"has_workflow_reference": true}
Delete custom property definitions
Required API key scopes
account:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /custom_property_definitions /: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/custom_property_definitions/:id/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.delete("<ph_app_host>/api/projects/{project_id}/custom_property_definitions/{custom_property_definition_id}/".format(project_id=project_id,custom_property_definition_id="<the custom property definition id>"),headers={"Authorization": "Bearer {}".format(api_key)},)
Example response
Status 204 No response body
Retrieve custom property definitions values
Required API key scopes
account:readQuery parameters
- keystring
- valuestring
Response
Example request
GET /api /projects /:project_id /custom_property_definitions /valuesexport POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/custom_property_definitions/values/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/custom_property_definitions/values/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
Example response
Status 200
RESPONSE
{"results": [{"name": "string"}],"refreshing": true}





