Environments-17

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

Endpoints

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

Create insights suggestions

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

Example request

POST /api/environments/:project_id/insights/:id/suggestions
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/:id/suggestions/\
-d name="string"

Example response

Status 200 No response body

Create insights suggestions

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

Example request

POST /api/environments/:project_id/insights/:id/suggestions
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/:id/suggestions/\
-d name="string"

Example response

Status 200 No response body

Retrieve insights activity

Required API key scopes

activity_log:read

Path parameters

  • project_id
    string

Query parameters

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

Example request

GET /api/environments/:project_id/insights/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/activity/

Example response

Status 200 No response body

Retrieve insights activity

Required API key scopes

activity_log:read

Path parameters

  • project_id
    string

Query parameters

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

Example request

GET /api/environments/:project_id/insights/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/activity/

Example response

Status 200 No response body

Create insights cancel

Path parameters

  • 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

Example request

POST /api/environments/:project_id/insights/cancel
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/cancel/\
-d name="string"

Example response

Status 200 No response body

Create insights cancel

Path parameters

  • 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

Example request

POST /api/environments/:project_id/insights/cancel
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/cancel/\
-d name="string"

Example response

Status 200 No response body

Retrieve insights my last viewed

Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.

Path parameters

  • project_id
    string

Query parameters

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

Example request

GET /api/environments/:project_id/insights/my_last_viewed
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/my_last_viewed/

Example response

Status 200 No response body

Retrieve insights my last viewed

Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.

Path parameters

  • project_id
    string

Query parameters

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

Example request

GET /api/environments/:project_id/insights/my_last_viewed
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/my_last_viewed/

Example response

Status 200 No response body

Create insights viewed

Update insight view timestamps. Expects: {"insight_ids": [1, 2, 3, ...]}

Required API key scopes

insight:read

Path parameters

  • 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

Example request

POST /api/environments/:project_id/insights/viewed
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/viewed/\
-d name="string"

Example response

Status 200 No response body

Create insights viewed

Update insight view timestamps. Expects: {"insight_ids": [1, 2, 3, ...]}

Required API key scopes

insight:read

Path parameters

  • 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

Example request

POST /api/environments/:project_id/insights/viewed
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/viewed/\
-d name="string"

Example response

Status 200 No response body

List all integrations

Required API key scopes

integration:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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,
"kind": "slack",
"config": null,
"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"
},
"errors": "string",
"display_name": "string"
}
]
}

Create integrations

Required API key scopes

integration:write

Path parameters

  • project_id
    string

Request parameters

  • kind
  • config

Response


Example request

POST /api/environments/:project_id/integrations
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/integrations/\
-d kind=undefined

Example response

Status 201
RESPONSE
{
"id": 0,
"kind": "slack",
"config": null,
"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"
},
"errors": "string",
"display_name": "string"
}

Retrieve integrations

Required API key scopes

integration:read

Path parameters

  • id
    integer
  • project_id
    string

Response


Example request

GET /api/environments/:project_id/integrations/: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/integrations/:id/

Example response

Status 200
RESPONSE
{
"id": 0,
"kind": "slack",
"config": null,
"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"
},
"errors": "string",
"display_name": "string"
}

Delete integrations

Required API key scopes

integration:write

Path parameters

  • id
    integer
  • project_id
    string

Example request

DELETE /api/environments/:project_id/integrations/: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/integrations/:id/

Example response

Status 204 No response body

Retrieve integrations channels

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

List all integrations clickup lists

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations clickup spaces

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations clickup workspaces

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Update integrations email

Path parameters

  • id
    integer
  • project_id
    string

Request parameters

  • kind
  • config

Response


Example request

PATCH /api/environments/:project_id/integrations/:id/email
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/integrations/:id/email/\
-d kind=undefined

Example response

Status 200
RESPONSE
{
"id": 0,
"kind": "slack",
"config": null,
"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"
},
"errors": "string",
"display_name": "string"
}

Create integrations email verify

Path parameters

  • id
    integer
  • project_id
    string

Request parameters

  • kind
  • config

Example request

POST /api/environments/:project_id/integrations/:id/email/verify
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/integrations/:id/email/verify/\
-d kind=undefined

Example response

Status 200 No response body
Next page →

Community questions

Questions about this page? or post a community question.