Property
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
List all property definitions
Path Parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query Parameters
- event_namesstring
If sent, response value will have
is_seen_on_filtered_events
populated. JSON-encoded - excluded_propertiesstring
JSON-encoded list of excluded properties
- filter_by_event_namesboolean
Whether to return only properties for events in
event_names
- group_type_indexinteger
What group type is the property for. Only should be set if
type=group
- is_feature_flagboolean
Whether to return only (or excluding) feature flag properties
- is_numericalboolean
Whether to return only (or excluding) numerical property definitions
- limitinteger
Number of results to return per page.
- offsetinteger
The initial index from which to return the results.
- propertiesstring
Comma-separated list of properties to filter
- searchstring
Searches properties by name
- typestringDefault:
event
One of:"event"
"person"
"group"
What property definitions to return
event
- eventperson
- persongroup
- group
Response
Request
GET
/api /projects /:project_id /property_definitions
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \https://app.posthog.com/api/projects/:project_id/property_definitions/
Response
Status 200
{"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": [null],"is_numerical": true,"updated_at": "2019-08-24T14:15:22Z","updated_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},"is_seen_on_filtered_events": "string","property_type": "DateTime","verified": true,"verified_at": "2019-08-24T14:15:22Z","verified_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}}]}
Retrieve property definitions
Path Parameters
- idstring
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Response
Request
GET
/api /projects /:project_id /property_definitions /:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \https://app.posthog.com/api/projects/:project_id/property_definitions/:id/
Response
Status 200
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","tags": [null],"is_numerical": true,"updated_at": "2019-08-24T14:15:22Z","updated_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},"is_seen_on_filtered_events": "string","property_type": "DateTime","verified": true,"verified_at": "2019-08-24T14:15:22Z","verified_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}}
Update property definitions
Path Parameters
- idstring
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request Parameters
- descriptionstring
- tagsarray
- property_typestringOne of:
"DateTime"
"String"
"Numeric"
"Boolean"
DateTime
- DateTimeString
- StringNumeric
- NumericBoolean
- Boolean
- verifiedboolean
Response
Request
PATCH
/api /projects /:project_id /property_definitions /:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X PATCH \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \https://app.posthog.com/api/projects/:project_id/property_definitions/:id/\-d name="string"
Response
Status 200
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","tags": [null],"is_numerical": true,"updated_at": "2019-08-24T14:15:22Z","updated_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},"is_seen_on_filtered_events": "string","property_type": "DateTime","verified": true,"verified_at": "2019-08-24T14:15:22Z","verified_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}}
Delete property definitions
Path Parameters
- idstring
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request
DELETE
/api /projects /:project_id /property_definitions /:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X DELETE \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \https://app.posthog.com/api/projects/:project_id/property_definitions/:id/
Response
Status 204 No response body
Retrieve property definitions seen together
Allows a caller to provide a list of event names and a single property name Returns a map of the event names to a boolean representing whether that property has ever been seen with that event_name
Path Parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Response
Request
GET
/api /projects /:project_id /property_definitions /seen_together
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \https://app.posthog.com/api/projects/:project_id/property_definitions/seen_together/
Response
Status 200
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","name": "string","description": "string","tags": [null],"is_numerical": true,"updated_at": "2019-08-24T14:15:22Z","updated_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},"is_seen_on_filtered_events": "string","property_type": "DateTime","verified": true,"verified_at": "2019-08-24T14:15:22Z","verified_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}}