Core-12

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

Endpoints

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

Retrieve integrations domain connect check

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

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"

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
}

Update property definitions

Required API key scopes

property_definition:write

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • description
    string
  • tags
    array
  • property_type
  • verified
    boolean
  • hidden
    boolean

Response


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

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
}

Delete property definitions

Required API key scopes

property_definition:write

Path parameters

  • id
    string
  • project_id
    string

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

Example 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

Required API key scopes

property_definition:read

Path parameters

  • project_id
    string

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

Example response

Status 200 No response body

List all session recordings sharing

Required API key scopes

sharing_configuration:read

Path parameters

  • project_id
    string
  • recording_id
    string

Example request

GET /api/projects/:project_id/session_recordings/:recording_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/session_recordings/:recording_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": "string"
}

Create session recordings sharing passwords

Create a new password for the sharing configuration.

Required API key scopes

sharing_configuration:write

Path parameters

  • project_id
    string
  • recording_id
    string

Request parameters

  • enabled
    boolean
  • settings
  • password_required
    boolean

Response


Example request

POST /api/projects/:project_id/session_recordings/:recording_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/session_recordings/:recording_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": "string"
}

Delete session recordings sharing passwords

Delete a password from the sharing configuration.

Required API key scopes

sharing_configuration:write

Path parameters

  • password_id
    string
  • project_id
    string
  • recording_id
    string

Example request

DELETE /api/projects/:project_id/session_recordings/:recording_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/session_recordings/:recording_id/sharing/passwords/:password_id/

Example response

Status 204 No response body

Create session recordings sharing refresh

Required API key scopes

sharing_configuration:write

Path parameters

  • project_id
    string
  • recording_id
    string

Request parameters

  • enabled
    boolean
  • settings
  • password_required
    boolean

Response


Example request

POST /api/projects/:project_id/session_recordings/:recording_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/session_recordings/:recording_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": "string"
}

List all subscriptions

Required API key scopes

subscription:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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": 0,
"dashboard": 0,
"insight": 0,
"target_type": "email",
"target_value": "string",
"frequency": "daily",
"interval": -2147483648,
"byweekday": [
"monday"
],
"bysetpos": -2147483648,
"count": -2147483648,
"start_date": "2019-08-24T14:15:22Z",
"until_date": "2019-08-24T14:15:22Z",
"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"
},
"deleted": true,
"title": "string",
"summary": "string",
"next_delivery_date": "2019-08-24T14:15:22Z",
"invite_message": "string"
}
]
}

Create subscriptions

Required API key scopes

subscription:write

Path parameters

  • project_id
    string

Request parameters

  • dashboard
    integer
  • insight
    integer
  • target_type
  • target_value
    string
  • frequency
  • interval
    integer
  • byweekday
    Click to open
    array
  • bysetpos
    integer
  • count
    integer
  • start_date
    string
  • until_date
    string
  • deleted
    boolean
  • title
    string
  • invite_message
    string

Response


Example request

POST /api/projects/:project_id/subscriptions
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/subscriptions/\
-d target_type=undefined,\
-d target_value="string",\
-d frequency=undefined,\
-d start_date="string"

Example response

Status 201
RESPONSE
{
"id": 0,
"dashboard": 0,
"insight": 0,
"target_type": "email",
"target_value": "string",
"frequency": "daily",
"interval": -2147483648,
"byweekday": [
"monday"
],
"bysetpos": -2147483648,
"count": -2147483648,
"start_date": "2019-08-24T14:15:22Z",
"until_date": "2019-08-24T14:15:22Z",
"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"
},
"deleted": true,
"title": "string",
"summary": "string",
"next_delivery_date": "2019-08-24T14:15:22Z",
"invite_message": "string"
}

Retrieve subscriptions

Required API key scopes

subscription:read

Path parameters

  • id
    integer
  • project_id
    string

Response


Example request

GET /api/projects/:project_id/subscriptions/: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/subscriptions/:id/

Example response

Status 200
RESPONSE
{
"id": 0,
"dashboard": 0,
"insight": 0,
"target_type": "email",
"target_value": "string",
"frequency": "daily",
"interval": -2147483648,
"byweekday": [
"monday"
],
"bysetpos": -2147483648,
"count": -2147483648,
"start_date": "2019-08-24T14:15:22Z",
"until_date": "2019-08-24T14:15:22Z",
"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"
},
"deleted": true,
"title": "string",
"summary": "string",
"next_delivery_date": "2019-08-24T14:15:22Z",
"invite_message": "string"
}

Update subscriptions

Required API key scopes

subscription:write

Path parameters

  • id
    integer
  • project_id
    string

Request parameters

  • dashboard
    integer
  • insight
    integer
  • target_type
  • target_value
    string
  • frequency
  • interval
    integer
  • byweekday
    Click to open
    array
  • bysetpos
    integer
  • count
    integer
  • start_date
    string
  • until_date
    string
  • deleted
    boolean
  • title
    string
  • invite_message
    string

Response


Example request

PATCH /api/projects/:project_id/subscriptions/: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/subscriptions/:id/\
-d dashboard="integer"

Example response

Status 200
RESPONSE
{
"id": 0,
"dashboard": 0,
"insight": 0,
"target_type": "email",
"target_value": "string",
"frequency": "daily",
"interval": -2147483648,
"byweekday": [
"monday"
],
"bysetpos": -2147483648,
"count": -2147483648,
"start_date": "2019-08-24T14:15:22Z",
"until_date": "2019-08-24T14:15:22Z",
"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"
},
"deleted": true,
"title": "string",
"summary": "string",
"next_delivery_date": "2019-08-24T14:15:22Z",
"invite_message": "string"
}

Delete subscriptions

Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true

Required API key scopes

subscription:write

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 405 No response body

List all users

Required API key scopes

user:read

Query parameters

  • email
    string
  • is_staff
    boolean
  • limit
    integer
  • offset
    integer

Response


Example request

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

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": [
{
"date_joined": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"pending_email": "user@example.com",
"is_email_verified": true,
"notification_settings": {
"property1": null,
"property2": null
},
"anonymize_data": true,
"allow_impersonation": true,
"toolbar_mode": "disabled",
"has_password": true,
"id": 0,
"is_staff": true,
"is_impersonated": true,
"is_impersonated_until": "string",
"is_impersonated_read_only": true,
"sensitive_session_expires_at": "string",
"team": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"project_id": -9223372036854776000,
"api_token": "string",
"name": "string",
"completed_snippet_onboarding": true,
"has_completed_onboarding_for": null,
"ingested_event": true,
"is_demo": true,
"timezone": "Africa/Abidjan",
"access_control": true
},
"organization": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"membership_level": 1,
"plugins_access_level": 0,
"teams": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "string",
"customer_id": "string",
"enforce_2fa": true,
"members_can_invite": true,
"members_can_use_personal_api_keys": true,
"allow_publicly_shared_resources": true,
"member_count": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_anonymize_ips": true,
"default_role_id": "string",
"is_active": true,
"is_not_active_reason": "string"
},
"organizations": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
"membership_level": 1,
"members_can_use_personal_api_keys": true,
"is_active": true,
"is_not_active_reason": "string"
}
],
"set_current_organization": "string",
"set_current_team": "string",
"password": "string",
"current_password": "string",
"events_column_config": null,
"is_2fa_enabled": true,
"has_social_auth": true,
"has_sso_enforcement": true,
"has_seen_product_intro_for": null,
"scene_personalisation": [
{
"scene": "string",
"dashboard": 0
}
],
"theme_mode": "light",
"hedgehog_config": null,
"allow_sidebar_suggestions": true,
"shortcut_position": "above",
"role_at_organization": "engineering",
"passkeys_enabled_for_2fa": true
}
]
}

Retrieve users

Required API key scopes

user:read

Path parameters

  • uuid
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"date_joined": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"pending_email": "user@example.com",
"is_email_verified": true,
"notification_settings": {
"property1": null,
"property2": null
},
"anonymize_data": true,
"allow_impersonation": true,
"toolbar_mode": "disabled",
"has_password": true,
"id": 0,
"is_staff": true,
"is_impersonated": true,
"is_impersonated_until": "string",
"is_impersonated_read_only": true,
"sensitive_session_expires_at": "string",
"team": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"project_id": -9223372036854776000,
"api_token": "string",
"name": "string",
"completed_snippet_onboarding": true,
"has_completed_onboarding_for": null,
"ingested_event": true,
"is_demo": true,
"timezone": "Africa/Abidjan",
"access_control": true
},
"organization": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"membership_level": 1,
"plugins_access_level": 0,
"teams": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "string",
"customer_id": "string",
"enforce_2fa": true,
"members_can_invite": true,
"members_can_use_personal_api_keys": true,
"allow_publicly_shared_resources": true,
"member_count": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_anonymize_ips": true,
"default_role_id": "string",
"is_active": true,
"is_not_active_reason": "string"
},
"organizations": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
"membership_level": 1,
"members_can_use_personal_api_keys": true,
"is_active": true,
"is_not_active_reason": "string"
}
],
"set_current_organization": "string",
"set_current_team": "string",
"password": "string",
"current_password": "string",
"events_column_config": null,
"is_2fa_enabled": true,
"has_social_auth": true,
"has_sso_enforcement": true,
"has_seen_product_intro_for": null,
"scene_personalisation": [
{
"scene": "string",
"dashboard": 0
}
],
"theme_mode": "light",
"hedgehog_config": null,
"allow_sidebar_suggestions": true,
"shortcut_position": "above",
"role_at_organization": "engineering",
"passkeys_enabled_for_2fa": true
}
Next page →

Community questions

Questions about this page? or post a community question.