Environments-25

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

Endpoints

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

Create create session summaries

Generate AI individual summary for each session, without grouping.

Path parameters

  • project_id
    string

Request parameters

  • session_ids
    array
  • focus_area
    string

Response


Example request

POST /api/environments/:project_id/session_summaries/create_session_summaries_individually
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/session_summaries/create_session_summaries_individually/\
-d session_ids="array"

Example response

Status 200
RESPONSE
{
"session_ids": [
"string"
],
"focus_area": "string"
}

Retrieve sessions property definitions

Required API key scopes

query:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve sessions property definitions

Required API key scopes

query:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve sessions values

Required API key scopes

query:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve sessions values

Required API key scopes

query:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

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/environments/:project_id/subscriptions
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/: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/environments/: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/environments/: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/environments/: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/environments/: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/environments/: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/environments/: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/environments/: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/environments/:project_id/subscriptions/:id/

Example response

Status 405 No response body

List all user interviews

Required API key scopes

user_interview_DO_NOT_USE:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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_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",
"interviewee_emails": [
"string"
],
"transcript": "string",
"summary": "string",
"audio": "http://example.com"
}
]
}

Create user interviews

Required API key scopes

user_interview_DO_NOT_USE:write

Path parameters

  • project_id
    string

Request parameters

  • interviewee_emails
    array
  • summary
    string
  • audio
    string

Response


Example request

POST /api/environments/:project_id/user_interviews
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/user_interviews/\
-d audio="string"

Example response

Status 201
RESPONSE
{
"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",
"interviewee_emails": [
"string"
],
"transcript": "string",
"summary": "string",
"audio": "http://example.com"
}

Retrieve user interviews

Required API key scopes

user_interview_DO_NOT_USE:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"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",
"interviewee_emails": [
"string"
],
"transcript": "string",
"summary": "string",
"audio": "http://example.com"
}

Update user interviews

Required API key scopes

user_interview_DO_NOT_USE:write

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • interviewee_emails
    array
  • summary
    string
  • audio
    string

Response


Example request

PATCH /api/environments/:project_id/user_interviews/: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/user_interviews/:id/\
-d created_by=undefined

Example response

Status 200
RESPONSE
{
"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",
"interviewee_emails": [
"string"
],
"transcript": "string",
"summary": "string",
"audio": "http://example.com"
}

Delete user interviews

Required API key scopes

user_interview_DO_NOT_USE:write

Path parameters

  • id
    string
  • project_id
    string

Example request

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

Example response

Status 204 No response body

List all warehouse saved queries

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_view:read

Path parameters

  • project_id
    string

Query parameters

  • page
    integer
  • search
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"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",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"latest_error": "string",
"is_materialized": true,
"origin": "data_warehouse"
}
]
}

Create warehouse saved queries

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_view:write

Path parameters

  • project_id
    string

Request parameters

  • deleted
    boolean
  • name
    string
  • query
  • edited_history_id
    string
  • soft_update
    boolean

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true,
"is_materialized": true,
"origin": "data_warehouse"
}

Retrieve warehouse saved queries

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_view:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true,
"is_materialized": true,
"origin": "data_warehouse"
}
Next page →

Community questions

Questions about this page? or post a community question.