Environments-19

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

Endpoints

POST
DELETE
POST
GET
GET
GET
PATCH
DELETE
GET

Create environments insights sharing passwords

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/environments/: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/environments/: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": "string"
}

Create environments insights sharing passwords

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/environments/: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/environments/: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": "string"
}

Delete environments 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/environments/: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/environments/:project_id/insights/:insight_id/sharing/passwords/:password_id/

Example response

Status 204 No response body

Delete environments 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/environments/: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/environments/:project_id/insights/:insight_id/sharing/passwords/:password_id/

Example response

Status 204 No response body

Create environments 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/environments/: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/environments/: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": "string"
}

Create environments 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/environments/: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/environments/: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": "string"
}

List all environments insights thresholds

Required API key scopes

alert:read

Path parameters

  • insight_id
    integer
  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
},
"alerts": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"created_at": "2019-08-24T14:15:22Z",
"insight": 0,
"name": "string",
"subscribed_users": [
0
],
"threshold": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
}
},
"condition": {
"type": "absolute_value"
},
"state": "Firing",
"enabled": true,
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"checks": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"calculated_value": 0.1,
"state": "Firing",
"targets_notified": true
}
],
"config": {
"check_ongoing_interval": null,
"series_index": 0,
"type": "TrendsAlertConfig"
},
"calculation_interval": "hourly",
"snoozed_until": "2019-08-24T14:15:22Z",
"skip_weekend": true
}
]
}
]
}

List all environments insights thresholds

Required API key scopes

alert:read

Path parameters

  • insight_id
    integer
  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
},
"alerts": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"created_at": "2019-08-24T14:15:22Z",
"insight": 0,
"name": "string",
"subscribed_users": [
0
],
"threshold": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
}
},
"condition": {
"type": "absolute_value"
},
"state": "Firing",
"enabled": true,
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"checks": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"calculated_value": 0.1,
"state": "Firing",
"targets_notified": true
}
],
"config": {
"check_ongoing_interval": null,
"series_index": 0,
"type": "TrendsAlertConfig"
},
"calculation_interval": "hourly",
"snoozed_until": "2019-08-24T14:15:22Z",
"skip_weekend": true
}
]
}
]
}

Retrieve environments insights thresholds

Required API key scopes

alert:read

Path parameters

  • id
    string
  • insight_id
    integer
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
},
"alerts": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"created_at": "2019-08-24T14:15:22Z",
"insight": 0,
"name": "string",
"subscribed_users": [
0
],
"threshold": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
}
},
"condition": {
"type": "absolute_value"
},
"state": "Firing",
"enabled": true,
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"checks": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"calculated_value": 0.1,
"state": "Firing",
"targets_notified": true
}
],
"config": {
"check_ongoing_interval": null,
"series_index": 0,
"type": "TrendsAlertConfig"
},
"calculation_interval": "hourly",
"snoozed_until": "2019-08-24T14:15:22Z",
"skip_weekend": true
}
]
}

Retrieve environments insights thresholds

Required API key scopes

alert:read

Path parameters

  • id
    string
  • insight_id
    integer
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
},
"alerts": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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"
},
"created_at": "2019-08-24T14:15:22Z",
"insight": 0,
"name": "string",
"subscribed_users": [
0
],
"threshold": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"name": "string",
"configuration": {
"bounds": {
"lower": null,
"upper": null
},
"type": "absolute"
}
},
"condition": {
"type": "absolute_value"
},
"state": "Firing",
"enabled": true,
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"checks": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"calculated_value": 0.1,
"state": "Firing",
"targets_notified": true
}
],
"config": {
"check_ongoing_interval": null,
"series_index": 0,
"type": "TrendsAlertConfig"
},
"calculation_interval": "hourly",
"snoozed_until": "2019-08-24T14:15:22Z",
"skip_weekend": true
}
]
}

Retrieve environments insights

Required API key scopes

insight:read

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"
  • from_dashboard
    integer
  • refresh
    string
    Default: force_cache
    One of: "async""async_except_on_cache_miss""blocking""force_async""force_blocking""force_cache""lazy_async"

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"short_id": "string",
"name": "string",
"derived_name": "string",
"query": {
"kind": "InsightVizNode",
"source": {
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"math": "total",
"name": "$pageview",
"event": "$pageview",
"version": 1
}
],
"version": 1
},
"version": 1
},
"order": -2147483648,
"deleted": true,
"dashboards": [
0
],
"dashboard_tiles": [
{
"id": 0,
"dashboard_id": 0,
"deleted": true
}
],
"last_refresh": "string",
"cache_target_age": "string",
"next_allowed_client_refresh": "string",
"result": "string",
"hasMore": "string",
"columns": "string",
"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"
},
"description": "string",
"updated_at": "2019-08-24T14:15:22Z",
"tags": [
null
],
"favorited": true,
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_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_sample": true,
"effective_restriction_level": 21,
"effective_privilege_level": 21,
"user_access_level": "string",
"timezone": "string",
"is_cached": "string",
"query_status": "string",
"hogql": "string",
"types": "string",
"resolved_date_range": "string",
"_create_in_folder": "string",
"alerts": "string",
"last_viewed_at": "string"
}

Retrieve environments insights

Required API key scopes

insight:read

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"
  • from_dashboard
    integer
  • refresh
    string
    Default: force_cache
    One of: "async""async_except_on_cache_miss""blocking""force_async""force_blocking""force_cache""lazy_async"

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"short_id": "string",
"name": "string",
"derived_name": "string",
"query": {
"kind": "InsightVizNode",
"source": {
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"math": "total",
"name": "$pageview",
"event": "$pageview",
"version": 1
}
],
"version": 1
},
"version": 1
},
"order": -2147483648,
"deleted": true,
"dashboards": [
0
],
"dashboard_tiles": [
{
"id": 0,
"dashboard_id": 0,
"deleted": true
}
],
"last_refresh": "string",
"cache_target_age": "string",
"next_allowed_client_refresh": "string",
"result": "string",
"hasMore": "string",
"columns": "string",
"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"
},
"description": "string",
"updated_at": "2019-08-24T14:15:22Z",
"tags": [
null
],
"favorited": true,
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_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_sample": true,
"effective_restriction_level": 21,
"effective_privilege_level": 21,
"user_access_level": "string",
"timezone": "string",
"is_cached": "string",
"query_status": "string",
"hogql": "string",
"types": "string",
"resolved_date_range": "string",
"_create_in_folder": "string",
"alerts": "string",
"last_viewed_at": "string"
}

Update environments insights

Required API key scopes

insight:write

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Request parameters

  • name
    string
  • derived_name
    string
  • query
    object
  • order
    integer
  • deleted
    boolean
  • dashboards
    array
  • description
    string
  • tags
    array
  • favorited
    boolean
  • _create_in_folder
    string

Response


Example request

PATCH /api/environments/:project_id/insights/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/insights/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"short_id": "string",
"name": "string",
"derived_name": "string",
"query": {
"kind": "InsightVizNode",
"source": {
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"math": "total",
"name": "$pageview",
"event": "$pageview",
"version": 1
}
],
"version": 1
},
"version": 1
},
"order": -2147483648,
"deleted": true,
"dashboards": [
0
],
"dashboard_tiles": [
{
"id": 0,
"dashboard_id": 0,
"deleted": true
}
],
"last_refresh": "string",
"cache_target_age": "string",
"next_allowed_client_refresh": "string",
"result": "string",
"hasMore": "string",
"columns": "string",
"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"
},
"description": "string",
"updated_at": "2019-08-24T14:15:22Z",
"tags": [
null
],
"favorited": true,
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_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_sample": true,
"effective_restriction_level": 21,
"effective_privilege_level": 21,
"user_access_level": "string",
"timezone": "string",
"is_cached": "string",
"query_status": "string",
"hogql": "string",
"types": "string",
"resolved_date_range": "string",
"_create_in_folder": "string",
"alerts": "string",
"last_viewed_at": "string"
}

Update environments insights

Required API key scopes

insight:write

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Request parameters

  • name
    string
  • derived_name
    string
  • query
    object
  • order
    integer
  • deleted
    boolean
  • dashboards
    array
  • description
    string
  • tags
    array
  • favorited
    boolean
  • _create_in_folder
    string

Response


Example request

PATCH /api/environments/:project_id/insights/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/insights/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"short_id": "string",
"name": "string",
"derived_name": "string",
"query": {
"kind": "InsightVizNode",
"source": {
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"math": "total",
"name": "$pageview",
"event": "$pageview",
"version": 1
}
],
"version": 1
},
"version": 1
},
"order": -2147483648,
"deleted": true,
"dashboards": [
0
],
"dashboard_tiles": [
{
"id": 0,
"dashboard_id": 0,
"deleted": true
}
],
"last_refresh": "string",
"cache_target_age": "string",
"next_allowed_client_refresh": "string",
"result": "string",
"hasMore": "string",
"columns": "string",
"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"
},
"description": "string",
"updated_at": "2019-08-24T14:15:22Z",
"tags": [
null
],
"favorited": true,
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_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_sample": true,
"effective_restriction_level": 21,
"effective_privilege_level": 21,
"user_access_level": "string",
"timezone": "string",
"is_cached": "string",
"query_status": "string",
"hogql": "string",
"types": "string",
"resolved_date_range": "string",
"_create_in_folder": "string",
"alerts": "string",
"last_viewed_at": "string"
}

Delete environments insights

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

Required API key scopes

insight:write

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

DELETE /api/environments/:project_id/insights/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/insights/:id/

Example response

Status 405 No response body

Delete environments insights

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

Required API key scopes

insight:write

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

DELETE /api/environments/:project_id/insights/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/insights/:id/

Example response

Status 405 No response body

Retrieve environments insights activity retrieve

Required API key scopes

activity_log:read

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body

Retrieve environments insights activity retrieve

Required API key scopes

activity_log:read

Path parameters

  • id
    integer
  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body
Next page →

Community questions

Questions about this page? or post a community question.