Environments-5

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

Stream dashboard metadata and tiles via Server-Sent Events. Sends metadata first, then tiles as they are rendered.

Endpoints

GET
POST
POST
GET
POST
GET
PATCH
DELETE
GET

Retrieve environments dashboards stream tiles

Path parameters

  • id
    integer

    A unique integer value identifying this dashboard.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

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

Example request

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

Example response

Status 200 No response body

Retrieve environments dashboards stream tiles

Path parameters

  • id
    integer

    A unique integer value identifying this dashboard.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

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

Example request

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

Example response

Status 200 No response body

Create environments dashboards create from template json

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

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

Request parameters

  • name
    string
  • description
    string
  • pinned
    boolean
  • last_accessed_at
    string
  • deleted
    boolean
  • breakdown_colors
  • data_color_theme_id
    integer
  • tags
    array
  • restriction_level
  • last_refresh
    string
  • use_template
    string
  • use_dashboard
    integer
  • delete_insights
    boolean
    Default: false
  • _create_in_folder
    string

Example request

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

Example response

Status 200 No response body

Create environments dashboards create from template json

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

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

Request parameters

  • name
    string
  • description
    string
  • pinned
    boolean
  • last_accessed_at
    string
  • deleted
    boolean
  • breakdown_colors
  • data_color_theme_id
    integer
  • tags
    array
  • restriction_level
  • last_refresh
    string
  • use_template
    string
  • use_dashboard
    integer
  • delete_insights
    boolean
    Default: false
  • _create_in_folder
    string

Example request

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

Example response

Status 200 No response body

Create environments dashboards create unlisted dashboard

Creates an unlisted dashboard from template by tag. Enforces uniqueness (one per tag per team). Returns 409 if unlisted dashboard with this tag already exists.

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

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

Request parameters

  • name
    string
  • description
    string
  • pinned
    boolean
  • last_accessed_at
    string
  • deleted
    boolean
  • breakdown_colors
  • data_color_theme_id
    integer
  • tags
    array
  • restriction_level
  • last_refresh
    string
  • use_template
    string
  • use_dashboard
    integer
  • delete_insights
    boolean
    Default: false
  • _create_in_folder
    string

Example request

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

Example response

Status 200 No response body

Create environments dashboards create unlisted dashboard

Creates an unlisted dashboard from template by tag. Enforces uniqueness (one per tag per team). Returns 409 if unlisted dashboard with this tag already exists.

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

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

Request parameters

  • name
    string
  • description
    string
  • pinned
    boolean
  • last_accessed_at
    string
  • deleted
    boolean
  • breakdown_colors
  • data_color_theme_id
    integer
  • tags
    array
  • restriction_level
  • last_refresh
    string
  • use_template
    string
  • use_dashboard
    integer
  • delete_insights
    boolean
    Default: false
  • _create_in_folder
    string

Example request

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

Example response

Status 200 No response body

List all environments data color themes

Required API key scopes

project:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


Response


Example request

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

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,
"name": "string",
"colors": null,
"is_global": "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"
}
}
]
}

List all environments data color themes

Required API key scopes

project:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


Response


Example request

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

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,
"name": "string",
"colors": null,
"is_global": "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"
}
}
]
}

Create environments data color themes

Required API key scopes

project:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • name
    string
  • colors

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": 0,
"name": "string",
"colors": null,
"is_global": "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"
}
}

Create environments data color themes

Required API key scopes

project:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • name
    string
  • colors

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": 0,
"name": "string",
"colors": null,
"is_global": "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"
}
}

Retrieve environments data color themes

Required API key scopes

project:read

Path parameters

  • id
    integer

    A unique integer value identifying this data color theme.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"name": "string",
"colors": null,
"is_global": "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"
}
}

Retrieve environments data color themes

Required API key scopes

project:read

Path parameters

  • id
    integer

    A unique integer value identifying this data color theme.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"name": "string",
"colors": null,
"is_global": "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"
}
}

Update environments data color themes

Required API key scopes

project:write

Path parameters

  • id
    integer

    A unique integer value identifying this data color theme.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • name
    string
  • colors

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"name": "string",
"colors": null,
"is_global": "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"
}
}

Update environments data color themes

Required API key scopes

project:write

Path parameters

  • id
    integer

    A unique integer value identifying this data color theme.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • name
    string
  • colors

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"name": "string",
"colors": null,
"is_global": "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"
}
}

Delete environments data color themes

Required API key scopes

project:write

Path parameters

  • id
    integer

    A unique integer value identifying this data color theme.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

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

Example response

Status 204 No response body

Delete environments data color themes

Required API key scopes

project:write

Path parameters

  • id
    integer

    A unique integer value identifying this data color theme.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

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

Example response

Status 204 No response body

List all environments dataset items

Required API key scopes

dataset:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • dataset
    string

    Filter by dataset ID

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


Response


Example request

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

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",
"dataset": "d93f2be0-02b1-4d87-8b6e-fc5cba21ed8d",
"input": null,
"output": null,
"metadata": null,
"ref_trace_id": "string",
"ref_timestamp": "2019-08-24T14:15:22Z",
"ref_source_id": "string",
"deleted": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_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"
},
"team": 0
}
]
}

List all environments dataset items

Required API key scopes

dataset:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • dataset
    string

    Filter by dataset ID

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


Response


Example request

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

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",
"dataset": "d93f2be0-02b1-4d87-8b6e-fc5cba21ed8d",
"input": null,
"output": null,
"metadata": null,
"ref_trace_id": "string",
"ref_timestamp": "2019-08-24T14:15:22Z",
"ref_source_id": "string",
"deleted": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_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"
},
"team": 0
}
]
}
Next page →

Community questions

Questions about this page? or post a community question.