Core-11

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
GET
GET
GET
GET
POST
GET
POST
DELETE
POST
GET
POST
GET
PATCH
DELETE
POST
GET
GET

Retrieve groups activity

Required API key scopes

activity_log:read

Path parameters

  • project_id
    string

Query parameters

  • group_type_index
    integer
  • id
    string

Example request

GET /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/

Example response

Status 200 No response body

Create groups delete property

Required API key scopes

group:write

Path parameters

  • project_id
    string

Query parameters

  • group_key
    string
  • group_type_index
    integer

Request parameters

  • group_type_index
    integer
  • group_key
    string
  • group_properties

Example request

POST /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"

Example response

Status 200 No response body

Retrieve groups find

Required API key scopes

group:read

Path parameters

  • project_id
    string

Query parameters

  • group_key
    string
  • group_type_index
    integer

Example request

GET /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/

Example response

Status 200 No response body

Retrieve groups property definitions

Required API key scopes

group:read

Path parameters

  • project_id
    string

Example request

GET /api/projects/:project_id/groups/property_definitions
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_definitions/

Example response

Status 200 No response body

Retrieve groups property values

Required API key scopes

group:read

Path parameters

  • project_id
    string

Example request

GET /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/

Example response

Status 200 No response body


Create groups update property

Required API key scopes

group:write

Path parameters

  • project_id
    string

Query parameters

  • group_key
    string
  • group_type_index
    integer

Request parameters

  • group_type_index
    integer
  • group_key
    string
  • group_properties

Example request

POST /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"

Example response

Status 200 No response body

List all insights sharing

Required API key scopes

sharing_configuration:read

Path parameters

  • insight_id
    integer
  • project_id
    string

Example request

GET /api/projects/:project_id/insights/:insight_id/sharing
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/insights/:insight_id/sharing/

Example response

Status 200
RESPONSE
{
"created_at": "2019-08-24T14:15:22Z",
"enabled": true,
"access_token": "string",
"settings": null,
"password_required": true,
"share_passwords": [
{
"id": 0,
"created_at": "2019-08-24T14:15:22Z",
"note": "string",
"created_by_email": "string",
"is_active": true
}
]
}

Create insights sharing passwords

Create a new password for the sharing configuration.

Required API key scopes

sharing_configuration:write

Path parameters

  • insight_id
    integer
  • project_id
    string

Request parameters

  • enabled
    boolean
  • settings
  • password_required
    boolean

Response


Example request

POST /api/projects/:project_id/insights/:insight_id/sharing/passwords
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/insights/:insight_id/sharing/passwords/\
-d created_at="string"

Example response

Status 200
RESPONSE
{
"created_at": "2019-08-24T14:15:22Z",
"enabled": true,
"access_token": "string",
"settings": null,
"password_required": true,
"share_passwords": [
{
"id": 0,
"created_at": "2019-08-24T14:15:22Z",
"note": "string",
"created_by_email": "string",
"is_active": true
}
]
}

Delete insights sharing passwords

Delete a password from the sharing configuration.

Required API key scopes

sharing_configuration:write

Path parameters

  • insight_id
    integer
  • password_id
    string
  • project_id
    string

Example request

DELETE /api/projects/:project_id/insights/:insight_id/sharing/passwords/:password_id
export 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/insights/:insight_id/sharing/passwords/:password_id/

Example response

Status 204 No response body

Create insights sharing refresh

Required API key scopes

sharing_configuration:write

Path parameters

  • insight_id
    integer
  • project_id
    string

Request parameters

  • enabled
    boolean
  • settings
  • password_required
    boolean

Response


Example request

POST /api/projects/:project_id/insights/:insight_id/sharing/refresh
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/insights/:insight_id/sharing/refresh/\
-d created_at="string"

Example response

Status 200
RESPONSE
{
"created_at": "2019-08-24T14:15:22Z",
"enabled": true,
"access_token": "string",
"settings": null,
"password_required": true,
"share_passwords": [
{
"id": 0,
"created_at": "2019-08-24T14:15:22Z",
"note": "string",
"created_by_email": "string",
"is_active": true
}
]
}

List all project secret api keys

Required API key scopes

project:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/project_secret_api_keys
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/project_secret_api_keys/

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": "string",
"label": "string",
"value": "string",
"mask_value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"last_used_at": "2019-08-24T14:15:22Z",
"last_rolled_at": "2019-08-24T14:15:22Z",
"scopes": [
"string"
]
}
]
}

Create project secret api keys

Required API key scopes

project:write

Path parameters

  • project_id
    string

Request parameters

  • label
    string
  • scopes
    array

Response


Example request

POST /api/projects/:project_id/project_secret_api_keys
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/project_secret_api_keys/\
-d label="string",\
-d scopes="array"

Example response

Status 201
RESPONSE
{
"id": "string",
"label": "string",
"value": "string",
"mask_value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"last_used_at": "2019-08-24T14:15:22Z",
"last_rolled_at": "2019-08-24T14:15:22Z",
"scopes": [
"string"
]
}

Retrieve project secret api keys

Required API key scopes

project:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

GET /api/projects/:project_id/project_secret_api_keys/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/project_secret_api_keys/:id/

Example response

Status 200
RESPONSE
{
"id": "string",
"label": "string",
"value": "string",
"mask_value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"last_used_at": "2019-08-24T14:15:22Z",
"last_rolled_at": "2019-08-24T14:15:22Z",
"scopes": [
"string"
]
}

Update project secret api keys

Required API key scopes

project:write

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • label
    string
  • scopes
    array

Response


Example request

PATCH /api/projects/:project_id/project_secret_api_keys/:id
export 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/project_secret_api_keys/:id/\
-d label="string"

Example response

Status 200
RESPONSE
{
"id": "string",
"label": "string",
"value": "string",
"mask_value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"last_used_at": "2019-08-24T14:15:22Z",
"last_rolled_at": "2019-08-24T14:15:22Z",
"scopes": [
"string"
]
}

Delete project secret api keys

Required API key scopes

project:write

Path parameters

  • id
    string
  • project_id
    string

Example request

DELETE /api/projects/:project_id/project_secret_api_keys/:id
export 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/project_secret_api_keys/:id/

Example response

Status 204 No response body

Create project secret api keys roll

Roll a project secret API key

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

POST /api/projects/:project_id/project_secret_api_keys/:id/roll
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/project_secret_api_keys/:id/roll/

Example response

Status 200
RESPONSE
{
"id": "string",
"label": "string",
"value": "string",
"mask_value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"last_used_at": "2019-08-24T14:15:22Z",
"last_rolled_at": "2019-08-24T14:15:22Z",
"scopes": [
"string"
]
}

List all property definitions

Required API key scopes

property_definition:read

Path parameters

  • project_id
    string

Query parameters

  • event_names
    string
  • exclude_core_properties
    boolean
    Default: false
  • exclude_hidden
    boolean
    Default: false
  • excluded_properties
    string
  • filter_by_event_names
    boolean
  • group_type_index
    integer
  • is_feature_flag
    boolean
  • is_numerical
    boolean
  • limit
    integer
  • offset
    integer
  • properties
    string
  • search
    string
  • type
    string
    Default: event
    One of: "event""person""group""session"
  • verified
    boolean

Response


Example 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" \
<ph_app_host>/api/projects/:project_id/property_definitions/

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",
"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,
"hedgehog_config": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"is_seen_on_filtered_events": true,
"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,
"hedgehog_config": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"hidden": true
}
]
}

Retrieve property definitions

Required API key scopes

property_definition:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example 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" \
<ph_app_host>/api/projects/:project_id/property_definitions/:id/

Example response

Status 200
RESPONSE
{
"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,
"hedgehog_config": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"is_seen_on_filtered_events": true,
"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,
"hedgehog_config": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"hidden": true
}
Next page →

Community questions

Questions about this page? or post a community question.