This endpoint returns a list of groups.
To add or modify group information, use the capture endpoint.
To query data related to groups, use the query endpoint and query the groups table or the events table and properties.$groups.
For instructions on how to authenticate to use this endpoint, see API overview.
GET | |
POST | |
GET | |
POST | |
GET | |
GET | |
GET | |
POST |
This endpoint returns a list of groups.
To add or modify group information, use the capture endpoint.
To query data related to groups, use the query endpoint and query the groups table or the events table and properties.$groups.
List all groups of a specific group type. You must pass ?group_type_index= in the URL. To get a list of valid group types, call /api/:project_id/groups_types/.
Uses forward-only keyset pagination via the cursor parameter.
The previous field in the response envelope is always null.
group:readGET /api/projects/:project_id/groups export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/groups/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/groups/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
{"group_type_index": -2147483648,"group_key": "string","group_properties": null,"created_at": "2019-08-24T14:15:22Z"}
group:writePOST /api/projects/:project_id/groups 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/groups/\-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/projects/{project_id}/groups/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={"group_type_index": "integer","group_key": "string"}).json()
{"group_type_index": -2147483648,"group_key": "string","group_properties": null,"created_at": "2019-08-24T14:15:22Z"}
activity_log:readGET /api/projects/:project_id/groups/activity export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/groups/activity/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/groups/activity/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
group:writePOST /api/projects/:project_id/groups/delete_property 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/groups/delete_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/projects/{project_id}/groups/delete_property/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},data={"group_type_index": "integer","group_key": "string"}).json()
group:readGET /api/projects/:project_id/groups/find export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/groups/find/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/groups/find/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
group:readGET /api/projects/:project_id/groups/property_values export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/groups/property_values/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/groups/property_values/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
group:readGET /api/projects/:project_id/groups/related export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/projects/:project_id/groups/related/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/groups/related/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
group:writePOST /api/projects/:project_id/groups/update_property 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/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/projects/{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()