Environments-13

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

Endpoints

    PATCH/api/environments/:project_id/subscriptions/:id/
    DELETE/api/environments/:project_id/subscriptions/:id/
    GET/api/projects/:project_id/environments/
    POST/api/projects/:project_id/environments/
    GET/api/projects/:project_id/environments/:id/
    PATCH/api/projects/:project_id/environments/:id/
    DELETE/api/projects/:project_id/environments/:id/
    GET/api/projects/:project_id/environments/:id/access_controls/
    GET/api/projects/:project_id/environments/:id/activity/
    PATCH/api/projects/:project_id/environments/:id/add_product_intent/
    PATCH/api/projects/:project_id/environments/:id/complete_product_onboarding/
    GET/api/projects/:project_id/environments/:id/global_access_controls/
    GET/api/projects/:project_id/environments/:id/is_generating_demo_data/
    PATCH/api/projects/:project_id/environments/:id/reset_token/

    Update environments subscriptions

    Required API key scopes

    subscription:write

    Path parameters

    • id
      integer

      A unique integer value identifying this subscription.

    • 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

    • 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


    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"

    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
    }
    },
    "deleted": true,
    "title": "string",
    "summary": "string",
    "next_delivery_date": "2019-08-24T14:15:22Z",
    "invite_message": "string"
    }

    Update environments subscriptions

    Required API key scopes

    subscription:write

    Path parameters

    • id
      integer

      A unique integer value identifying this subscription.

    • 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

    • 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


    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"

    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
    }
    },
    "deleted": true,
    "title": "string",
    "summary": "string",
    "next_delivery_date": "2019-08-24T14:15:22Z",
    "invite_message": "string"
    }

    Delete environments 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

      A unique integer value identifying this subscription.

    • 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

    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/

    Response

    Status 405 No response body

    Delete environments 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

      A unique integer value identifying this subscription.

    • 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

    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/

    Response

    Status 405 No response body

    List all environments

    Projects for the current organization.

    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


    Request

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

    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,
    "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
    }
    ]
    }

    Create environments

    Projects for the current organization.

    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

    • app_urls
      array
    • name
      string
    • slack_incoming_webhook
      string
    • anonymize_ips
      boolean
    • completed_snippet_onboarding
      boolean
    • test_account_filters
    • test_account_filters_default_checked
      boolean
    • path_cleaning_filters
    • is_demo
      boolean
    • timezone
    • data_attributes
    • person_display_name_properties
      array
    • correlation_config
    • autocapture_opt_out
      boolean
    • autocapture_exceptions_opt_in
      boolean
    • autocapture_web_vitals_opt_in
      boolean
    • autocapture_web_vitals_allowed_metrics
    • autocapture_exceptions_errors_to_ignore
    • capture_console_log_opt_in
      boolean
    • capture_performance_opt_in
      boolean
    • session_recording_opt_in
      boolean
    • session_recording_sample_rate
      string
    • session_recording_minimum_duration_milliseconds
      integer
    • session_recording_linked_flag
    • session_recording_network_payload_capture_config
    • session_recording_url_trigger_config
      array
    • session_recording_url_blocklist_config
      array
    • session_recording_event_trigger_config
      array
    • session_replay_config
    • survey_config
    • access_control
      boolean
    • week_start_day
    • primary_dashboard
      integer
    • live_events_columns
      array
    • recording_domains
      array
    • cookieless_server_hash_mode
    • inject_web_apps
      boolean
    • extra_settings
    • modifiers
    • has_completed_onboarding_for
    • surveys_opt_in
      boolean
    • heatmaps_opt_in
      boolean
    • capture_dead_clicks
      boolean

    Response


    Request

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

    Response

    Status 201
    RESPONSE
    {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
    "project_id": -9223372036854776000,
    "api_token": "string",
    "app_urls": [
    "string"
    ],
    "name": "string",
    "slack_incoming_webhook": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "anonymize_ips": true,
    "completed_snippet_onboarding": true,
    "ingested_event": true,
    "test_account_filters": null,
    "test_account_filters_default_checked": true,
    "path_cleaning_filters": null,
    "is_demo": true,
    "timezone": "Africa/Abidjan",
    "data_attributes": null,
    "person_display_name_properties": [
    "string"
    ],
    "correlation_config": null,
    "autocapture_opt_out": true,
    "autocapture_exceptions_opt_in": true,
    "autocapture_web_vitals_opt_in": true,
    "autocapture_web_vitals_allowed_metrics": null,
    "autocapture_exceptions_errors_to_ignore": null,
    "capture_console_log_opt_in": true,
    "capture_performance_opt_in": true,
    "session_recording_opt_in": true,
    "session_recording_sample_rate": "string",
    "session_recording_minimum_duration_milliseconds": 15000,
    "session_recording_linked_flag": null,
    "session_recording_network_payload_capture_config": null,
    "session_recording_url_trigger_config": [
    null
    ],
    "session_recording_url_blocklist_config": [
    null
    ],
    "session_recording_event_trigger_config": [
    "string"
    ],
    "session_replay_config": null,
    "survey_config": null,
    "effective_membership_level": 1,
    "access_control": true,
    "week_start_day": 0,
    "has_group_types": true,
    "primary_dashboard": 0,
    "live_events_columns": [
    "string"
    ],
    "recording_domains": [
    "string"
    ],
    "cookieless_server_hash_mode": 0,
    "person_on_events_querying_enabled": true,
    "inject_web_apps": true,
    "extra_settings": null,
    "modifiers": null,
    "default_modifiers": {
    "property1": null,
    "property2": null
    },
    "has_completed_onboarding_for": null,
    "surveys_opt_in": true,
    "heatmaps_opt_in": true,
    "live_events_token": "string",
    "product_intents": "string",
    "capture_dead_clicks": true,
    "user_access_level": "string"
    }

    Retrieve environments

    Projects for the current organization.

    Required API key scopes

    project:read

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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


    Request

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

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
    "project_id": -9223372036854776000,
    "api_token": "string",
    "app_urls": [
    "string"
    ],
    "name": "string",
    "slack_incoming_webhook": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "anonymize_ips": true,
    "completed_snippet_onboarding": true,
    "ingested_event": true,
    "test_account_filters": null,
    "test_account_filters_default_checked": true,
    "path_cleaning_filters": null,
    "is_demo": true,
    "timezone": "Africa/Abidjan",
    "data_attributes": null,
    "person_display_name_properties": [
    "string"
    ],
    "correlation_config": null,
    "autocapture_opt_out": true,
    "autocapture_exceptions_opt_in": true,
    "autocapture_web_vitals_opt_in": true,
    "autocapture_web_vitals_allowed_metrics": null,
    "autocapture_exceptions_errors_to_ignore": null,
    "capture_console_log_opt_in": true,
    "capture_performance_opt_in": true,
    "session_recording_opt_in": true,
    "session_recording_sample_rate": "string",
    "session_recording_minimum_duration_milliseconds": 15000,
    "session_recording_linked_flag": null,
    "session_recording_network_payload_capture_config": null,
    "session_recording_url_trigger_config": [
    null
    ],
    "session_recording_url_blocklist_config": [
    null
    ],
    "session_recording_event_trigger_config": [
    "string"
    ],
    "session_replay_config": null,
    "survey_config": null,
    "effective_membership_level": 1,
    "access_control": true,
    "week_start_day": 0,
    "has_group_types": true,
    "primary_dashboard": 0,
    "live_events_columns": [
    "string"
    ],
    "recording_domains": [
    "string"
    ],
    "cookieless_server_hash_mode": 0,
    "person_on_events_querying_enabled": true,
    "inject_web_apps": true,
    "extra_settings": null,
    "modifiers": null,
    "default_modifiers": {
    "property1": null,
    "property2": null
    },
    "has_completed_onboarding_for": null,
    "surveys_opt_in": true,
    "heatmaps_opt_in": true,
    "live_events_token": "string",
    "product_intents": "string",
    "capture_dead_clicks": true,
    "user_access_level": "string"
    }

    Update environments

    Projects for the current organization.

    Required API key scopes

    project:write

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

    • app_urls
      array
    • name
      string
    • slack_incoming_webhook
      string
    • anonymize_ips
      boolean
    • completed_snippet_onboarding
      boolean
    • test_account_filters
    • test_account_filters_default_checked
      boolean
    • path_cleaning_filters
    • is_demo
      boolean
    • timezone
    • data_attributes
    • person_display_name_properties
      array
    • correlation_config
    • autocapture_opt_out
      boolean
    • autocapture_exceptions_opt_in
      boolean
    • autocapture_web_vitals_opt_in
      boolean
    • autocapture_web_vitals_allowed_metrics
    • autocapture_exceptions_errors_to_ignore
    • capture_console_log_opt_in
      boolean
    • capture_performance_opt_in
      boolean
    • session_recording_opt_in
      boolean
    • session_recording_sample_rate
      string
    • session_recording_minimum_duration_milliseconds
      integer
    • session_recording_linked_flag
    • session_recording_network_payload_capture_config
    • session_recording_url_trigger_config
      array
    • session_recording_url_blocklist_config
      array
    • session_recording_event_trigger_config
      array
    • session_replay_config
    • survey_config
    • access_control
      boolean
    • week_start_day
    • primary_dashboard
      integer
    • live_events_columns
      array
    • recording_domains
      array
    • cookieless_server_hash_mode
    • inject_web_apps
      boolean
    • extra_settings
    • modifiers
    • has_completed_onboarding_for
    • surveys_opt_in
      boolean
    • heatmaps_opt_in
      boolean
    • capture_dead_clicks
      boolean

    Response


    Request

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

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
    "project_id": -9223372036854776000,
    "api_token": "string",
    "app_urls": [
    "string"
    ],
    "name": "string",
    "slack_incoming_webhook": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "anonymize_ips": true,
    "completed_snippet_onboarding": true,
    "ingested_event": true,
    "test_account_filters": null,
    "test_account_filters_default_checked": true,
    "path_cleaning_filters": null,
    "is_demo": true,
    "timezone": "Africa/Abidjan",
    "data_attributes": null,
    "person_display_name_properties": [
    "string"
    ],
    "correlation_config": null,
    "autocapture_opt_out": true,
    "autocapture_exceptions_opt_in": true,
    "autocapture_web_vitals_opt_in": true,
    "autocapture_web_vitals_allowed_metrics": null,
    "autocapture_exceptions_errors_to_ignore": null,
    "capture_console_log_opt_in": true,
    "capture_performance_opt_in": true,
    "session_recording_opt_in": true,
    "session_recording_sample_rate": "string",
    "session_recording_minimum_duration_milliseconds": 15000,
    "session_recording_linked_flag": null,
    "session_recording_network_payload_capture_config": null,
    "session_recording_url_trigger_config": [
    null
    ],
    "session_recording_url_blocklist_config": [
    null
    ],
    "session_recording_event_trigger_config": [
    "string"
    ],
    "session_replay_config": null,
    "survey_config": null,
    "effective_membership_level": 1,
    "access_control": true,
    "week_start_day": 0,
    "has_group_types": true,
    "primary_dashboard": 0,
    "live_events_columns": [
    "string"
    ],
    "recording_domains": [
    "string"
    ],
    "cookieless_server_hash_mode": 0,
    "person_on_events_querying_enabled": true,
    "inject_web_apps": true,
    "extra_settings": null,
    "modifiers": null,
    "default_modifiers": {
    "property1": null,
    "property2": null
    },
    "has_completed_onboarding_for": null,
    "surveys_opt_in": true,
    "heatmaps_opt_in": true,
    "live_events_token": "string",
    "product_intents": "string",
    "capture_dead_clicks": true,
    "user_access_level": "string"
    }

    Delete environments

    Projects for the current organization.

    Required API key scopes

    project:write

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

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

    Response

    Status 204 No response body

    Retrieve environments access controls

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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


    Request

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

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
    "project_id": -9223372036854776000,
    "api_token": "string",
    "app_urls": [
    "string"
    ],
    "name": "string",
    "slack_incoming_webhook": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "anonymize_ips": true,
    "completed_snippet_onboarding": true,
    "ingested_event": true,
    "test_account_filters": null,
    "test_account_filters_default_checked": true,
    "path_cleaning_filters": null,
    "is_demo": true,
    "timezone": "Africa/Abidjan",
    "data_attributes": null,
    "person_display_name_properties": [
    "string"
    ],
    "correlation_config": null,
    "autocapture_opt_out": true,
    "autocapture_exceptions_opt_in": true,
    "autocapture_web_vitals_opt_in": true,
    "autocapture_web_vitals_allowed_metrics": null,
    "autocapture_exceptions_errors_to_ignore": null,
    "capture_console_log_opt_in": true,
    "capture_performance_opt_in": true,
    "session_recording_opt_in": true,
    "session_recording_sample_rate": "string",
    "session_recording_minimum_duration_milliseconds": 15000,
    "session_recording_linked_flag": null,
    "session_recording_network_payload_capture_config": null,
    "session_recording_url_trigger_config": [
    null
    ],
    "session_recording_url_blocklist_config": [
    null
    ],
    "session_recording_event_trigger_config": [
    "string"
    ],
    "session_replay_config": null,
    "survey_config": null,
    "effective_membership_level": 1,
    "access_control": true,
    "week_start_day": 0,
    "has_group_types": true,
    "primary_dashboard": 0,
    "live_events_columns": [
    "string"
    ],
    "recording_domains": [
    "string"
    ],
    "cookieless_server_hash_mode": 0,
    "person_on_events_querying_enabled": true,
    "inject_web_apps": true,
    "extra_settings": null,
    "modifiers": null,
    "default_modifiers": {
    "property1": null,
    "property2": null
    },
    "has_completed_onboarding_for": null,
    "surveys_opt_in": true,
    "heatmaps_opt_in": true,
    "live_events_token": "string",
    "product_intents": "string",
    "capture_dead_clicks": true,
    "user_access_level": "string"
    }

    Retrieve environments activity

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

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

    Response

    Status 200 No response body

    Update environments add product intent

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

    • app_urls
      array
    • name
      string
    • slack_incoming_webhook
      string
    • anonymize_ips
      boolean
    • completed_snippet_onboarding
      boolean
    • test_account_filters
    • test_account_filters_default_checked
      boolean
    • path_cleaning_filters
    • is_demo
      boolean
    • timezone
    • data_attributes
    • person_display_name_properties
      array
    • correlation_config
    • autocapture_opt_out
      boolean
    • autocapture_exceptions_opt_in
      boolean
    • autocapture_web_vitals_opt_in
      boolean
    • autocapture_web_vitals_allowed_metrics
    • autocapture_exceptions_errors_to_ignore
    • capture_console_log_opt_in
      boolean
    • capture_performance_opt_in
      boolean
    • session_recording_opt_in
      boolean
    • session_recording_sample_rate
      string
    • session_recording_minimum_duration_milliseconds
      integer
    • session_recording_linked_flag
    • session_recording_network_payload_capture_config
    • session_recording_url_trigger_config
      array
    • session_recording_url_blocklist_config
      array
    • session_recording_event_trigger_config
      array
    • session_replay_config
    • survey_config
    • access_control
      boolean
    • week_start_day
    • primary_dashboard
      integer
    • live_events_columns
      array
    • recording_domains
      array
    • cookieless_server_hash_mode
    • inject_web_apps
      boolean
    • extra_settings
    • modifiers
    • has_completed_onboarding_for
    • surveys_opt_in
      boolean
    • heatmaps_opt_in
      boolean
    • capture_dead_clicks
      boolean

    Request

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

    Response

    Status 200 No response body

    Update environments complete product onboarding

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

    • app_urls
      array
    • name
      string
    • slack_incoming_webhook
      string
    • anonymize_ips
      boolean
    • completed_snippet_onboarding
      boolean
    • test_account_filters
    • test_account_filters_default_checked
      boolean
    • path_cleaning_filters
    • is_demo
      boolean
    • timezone
    • data_attributes
    • person_display_name_properties
      array
    • correlation_config
    • autocapture_opt_out
      boolean
    • autocapture_exceptions_opt_in
      boolean
    • autocapture_web_vitals_opt_in
      boolean
    • autocapture_web_vitals_allowed_metrics
    • autocapture_exceptions_errors_to_ignore
    • capture_console_log_opt_in
      boolean
    • capture_performance_opt_in
      boolean
    • session_recording_opt_in
      boolean
    • session_recording_sample_rate
      string
    • session_recording_minimum_duration_milliseconds
      integer
    • session_recording_linked_flag
    • session_recording_network_payload_capture_config
    • session_recording_url_trigger_config
      array
    • session_recording_url_blocklist_config
      array
    • session_recording_event_trigger_config
      array
    • session_replay_config
    • survey_config
    • access_control
      boolean
    • week_start_day
    • primary_dashboard
      integer
    • live_events_columns
      array
    • recording_domains
      array
    • cookieless_server_hash_mode
    • inject_web_apps
      boolean
    • extra_settings
    • modifiers
    • has_completed_onboarding_for
    • surveys_opt_in
      boolean
    • heatmaps_opt_in
      boolean
    • capture_dead_clicks
      boolean

    Request

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

    Response

    Status 200 No response body

    Retrieve environments global access controls

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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


    Request

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

    Response

    Status 200
    RESPONSE
    {
    "id": 0,
    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
    "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
    "project_id": -9223372036854776000,
    "api_token": "string",
    "app_urls": [
    "string"
    ],
    "name": "string",
    "slack_incoming_webhook": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "anonymize_ips": true,
    "completed_snippet_onboarding": true,
    "ingested_event": true,
    "test_account_filters": null,
    "test_account_filters_default_checked": true,
    "path_cleaning_filters": null,
    "is_demo": true,
    "timezone": "Africa/Abidjan",
    "data_attributes": null,
    "person_display_name_properties": [
    "string"
    ],
    "correlation_config": null,
    "autocapture_opt_out": true,
    "autocapture_exceptions_opt_in": true,
    "autocapture_web_vitals_opt_in": true,
    "autocapture_web_vitals_allowed_metrics": null,
    "autocapture_exceptions_errors_to_ignore": null,
    "capture_console_log_opt_in": true,
    "capture_performance_opt_in": true,
    "session_recording_opt_in": true,
    "session_recording_sample_rate": "string",
    "session_recording_minimum_duration_milliseconds": 15000,
    "session_recording_linked_flag": null,
    "session_recording_network_payload_capture_config": null,
    "session_recording_url_trigger_config": [
    null
    ],
    "session_recording_url_blocklist_config": [
    null
    ],
    "session_recording_event_trigger_config": [
    "string"
    ],
    "session_replay_config": null,
    "survey_config": null,
    "effective_membership_level": 1,
    "access_control": true,
    "week_start_day": 0,
    "has_group_types": true,
    "primary_dashboard": 0,
    "live_events_columns": [
    "string"
    ],
    "recording_domains": [
    "string"
    ],
    "cookieless_server_hash_mode": 0,
    "person_on_events_querying_enabled": true,
    "inject_web_apps": true,
    "extra_settings": null,
    "modifiers": null,
    "default_modifiers": {
    "property1": null,
    "property2": null
    },
    "has_completed_onboarding_for": null,
    "surveys_opt_in": true,
    "heatmaps_opt_in": true,
    "live_events_token": "string",
    "product_intents": "string",
    "capture_dead_clicks": true,
    "user_access_level": "string"
    }

    Retrieve environments is generating demo data

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

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

    Response

    Status 200 No response body

    Update environments reset token

    Projects for the current organization.

    Path parameters

    • id
      integer

      A unique integer value identifying this team (soon to be environment).

    • 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

    • app_urls
      array
    • name
      string
    • slack_incoming_webhook
      string
    • anonymize_ips
      boolean
    • completed_snippet_onboarding
      boolean
    • test_account_filters
    • test_account_filters_default_checked
      boolean
    • path_cleaning_filters
    • is_demo
      boolean
    • timezone
    • data_attributes
    • person_display_name_properties
      array
    • correlation_config
    • autocapture_opt_out
      boolean
    • autocapture_exceptions_opt_in
      boolean
    • autocapture_web_vitals_opt_in
      boolean
    • autocapture_web_vitals_allowed_metrics
    • autocapture_exceptions_errors_to_ignore
    • capture_console_log_opt_in
      boolean
    • capture_performance_opt_in
      boolean
    • session_recording_opt_in
      boolean
    • session_recording_sample_rate
      string
    • session_recording_minimum_duration_milliseconds
      integer
    • session_recording_linked_flag
    • session_recording_network_payload_capture_config
    • session_recording_url_trigger_config
      array
    • session_recording_url_blocklist_config
      array
    • session_recording_event_trigger_config
      array
    • session_replay_config
    • survey_config
    • access_control
      boolean
    • week_start_day
    • primary_dashboard
      integer
    • live_events_columns
      array
    • recording_domains
      array
    • cookieless_server_hash_mode
    • inject_web_apps
      boolean
    • extra_settings
    • modifiers
    • has_completed_onboarding_for
    • surveys_opt_in
      boolean
    • heatmaps_opt_in
      boolean
    • capture_dead_clicks
      boolean

    Request

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

    Response

    Status 200 No response body

    Questions?

    Was this page useful?