Core-6

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

Endpoints

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

Update complete product onboarding

Projects for the current organization.

Required API key scopes

project:read

Path parameters

  • id
    integer
  • organization_id
    string

Request parameters

  • name
    string
  • product_description
    string
  • app_urls
    array
  • 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_masking_config
  • session_replay_config
  • survey_config
  • access_control
    boolean
  • week_start_day
  • primary_dashboard
    integer
  • live_events_columns
    array
  • recording_domains
    array
  • inject_web_apps
    boolean
  • extra_settings
  • modifiers
  • has_completed_onboarding_for
  • surveys_opt_in
    boolean
  • heatmaps_opt_in
    boolean
  • flags_persistence_default
    boolean
  • receive_org_level_activity_logs
    boolean
  • business_model
  • conversations_enabled
    boolean
  • conversations_settings
  • logs_settings

Response


Example request

PATCH /api/organizations/:organization_id/projects/: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/organizations/:organization_id/projects/:id/complete_product_onboarding/\
-d organization="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"name": "string",
"product_description": "string",
"created_at": "2019-08-24T14:15:22Z",
"effective_membership_level": 1,
"has_group_types": true,
"group_types": [
{
"property1": null,
"property2": null
}
],
"live_events_token": "string",
"updated_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"api_token": "string",
"app_urls": [
"string"
],
"slack_incoming_webhook": "string",
"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": 30000,
"session_recording_linked_flag": null,
"session_recording_network_payload_capture_config": null,
"session_recording_masking_config": null,
"session_replay_config": null,
"survey_config": null,
"access_control": true,
"week_start_day": 0,
"primary_dashboard": 0,
"live_events_columns": [
"string"
],
"recording_domains": [
"string"
],
"person_on_events_querying_enabled": "string",
"inject_web_apps": true,
"extra_settings": null,
"modifiers": null,
"default_modifiers": "string",
"has_completed_onboarding_for": null,
"surveys_opt_in": true,
"heatmaps_opt_in": true,
"product_intents": "string",
"flags_persistence_default": true,
"secret_api_token": "string",
"secret_api_token_backup": "string",
"receive_org_level_activity_logs": true,
"business_model": "b2b",
"conversations_enabled": true,
"conversations_settings": null,
"logs_settings": null
}

Update delete secret token backup

Projects for the current organization.

Path parameters

  • id
    integer
  • organization_id
    string

Request parameters

  • name
    string
  • product_description
    string
  • app_urls
    array
  • 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_masking_config
  • session_replay_config
  • survey_config
  • access_control
    boolean
  • week_start_day
  • primary_dashboard
    integer
  • live_events_columns
    array
  • recording_domains
    array
  • inject_web_apps
    boolean
  • extra_settings
  • modifiers
  • has_completed_onboarding_for
  • surveys_opt_in
    boolean
  • heatmaps_opt_in
    boolean
  • flags_persistence_default
    boolean
  • receive_org_level_activity_logs
    boolean
  • business_model
  • conversations_enabled
    boolean
  • conversations_settings
  • logs_settings

Response


Example request

PATCH /api/organizations/:organization_id/projects/:id/delete_secret_token_backup
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/organizations/:organization_id/projects/:id/delete_secret_token_backup/\
-d organization="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"name": "string",
"product_description": "string",
"created_at": "2019-08-24T14:15:22Z",
"effective_membership_level": 1,
"has_group_types": true,
"group_types": [
{
"property1": null,
"property2": null
}
],
"live_events_token": "string",
"updated_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"api_token": "string",
"app_urls": [
"string"
],
"slack_incoming_webhook": "string",
"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": 30000,
"session_recording_linked_flag": null,
"session_recording_network_payload_capture_config": null,
"session_recording_masking_config": null,
"session_replay_config": null,
"survey_config": null,
"access_control": true,
"week_start_day": 0,
"primary_dashboard": 0,
"live_events_columns": [
"string"
],
"recording_domains": [
"string"
],
"person_on_events_querying_enabled": "string",
"inject_web_apps": true,
"extra_settings": null,
"modifiers": null,
"default_modifiers": "string",
"has_completed_onboarding_for": null,
"surveys_opt_in": true,
"heatmaps_opt_in": true,
"product_intents": "string",
"flags_persistence_default": true,
"secret_api_token": "string",
"secret_api_token_backup": "string",
"receive_org_level_activity_logs": true,
"business_model": "b2b",
"conversations_enabled": true,
"conversations_settings": null,
"logs_settings": null
}

Create generate conversations public token

Projects for the current organization.

Path parameters

  • id
    integer
  • organization_id
    string

Request parameters

  • name
    string
  • product_description
    string
  • app_urls
    array
  • 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_masking_config
  • session_replay_config
  • survey_config
  • access_control
    boolean
  • week_start_day
  • primary_dashboard
    integer
  • live_events_columns
    array
  • recording_domains
    array
  • inject_web_apps
    boolean
  • extra_settings
  • modifiers
  • has_completed_onboarding_for
  • surveys_opt_in
    boolean
  • heatmaps_opt_in
    boolean
  • flags_persistence_default
    boolean
  • receive_org_level_activity_logs
    boolean
  • business_model
  • conversations_enabled
    boolean
  • conversations_settings
  • logs_settings

Response


Example request

POST /api/organizations/:organization_id/projects/:id/generate_conversations_public_token
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/organizations/:organization_id/projects/:id/generate_conversations_public_token/\
-d organization="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"name": "string",
"product_description": "string",
"created_at": "2019-08-24T14:15:22Z",
"effective_membership_level": 1,
"has_group_types": true,
"group_types": [
{
"property1": null,
"property2": null
}
],
"live_events_token": "string",
"updated_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"api_token": "string",
"app_urls": [
"string"
],
"slack_incoming_webhook": "string",
"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": 30000,
"session_recording_linked_flag": null,
"session_recording_network_payload_capture_config": null,
"session_recording_masking_config": null,
"session_replay_config": null,
"survey_config": null,
"access_control": true,
"week_start_day": 0,
"primary_dashboard": 0,
"live_events_columns": [
"string"
],
"recording_domains": [
"string"
],
"person_on_events_querying_enabled": "string",
"inject_web_apps": true,
"extra_settings": null,
"modifiers": null,
"default_modifiers": "string",
"has_completed_onboarding_for": null,
"surveys_opt_in": true,
"heatmaps_opt_in": true,
"product_intents": "string",
"flags_persistence_default": true,
"secret_api_token": "string",
"secret_api_token_backup": "string",
"receive_org_level_activity_logs": true,
"business_model": "b2b",
"conversations_enabled": true,
"conversations_settings": null,
"logs_settings": null
}

Retrieve is generating demo data

Projects for the current organization.

Path parameters

  • id
    integer
  • organization_id
    string

Response


Example request

GET /api/organizations/:organization_id/projects/: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/organizations/:organization_id/projects/:id/is_generating_demo_data/

Example response

Status 200
RESPONSE
{
"id": 0,
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"name": "string",
"product_description": "string",
"created_at": "2019-08-24T14:15:22Z",
"effective_membership_level": 1,
"has_group_types": true,
"group_types": [
{
"property1": null,
"property2": null
}
],
"live_events_token": "string",
"updated_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"api_token": "string",
"app_urls": [
"string"
],
"slack_incoming_webhook": "string",
"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": 30000,
"session_recording_linked_flag": null,
"session_recording_network_payload_capture_config": null,
"session_recording_masking_config": null,
"session_replay_config": null,
"survey_config": null,
"access_control": true,
"week_start_day": 0,
"primary_dashboard": 0,
"live_events_columns": [
"string"
],
"recording_domains": [
"string"
],
"person_on_events_querying_enabled": "string",
"inject_web_apps": true,
"extra_settings": null,
"modifiers": null,
"default_modifiers": "string",
"has_completed_onboarding_for": null,
"surveys_opt_in": true,
"heatmaps_opt_in": true,
"product_intents": "string",
"flags_persistence_default": true,
"secret_api_token": "string",
"secret_api_token_backup": "string",
"receive_org_level_activity_logs": true,
"business_model": "b2b",
"conversations_enabled": true,
"conversations_settings": null,
"logs_settings": null
}

Update reset token

Projects for the current organization.

Path parameters

  • id
    integer
  • organization_id
    string

Request parameters

  • name
    string
  • product_description
    string
  • app_urls
    array
  • 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_masking_config
  • session_replay_config
  • survey_config
  • access_control
    boolean
  • week_start_day
  • primary_dashboard
    integer
  • live_events_columns
    array
  • recording_domains
    array
  • inject_web_apps
    boolean
  • extra_settings
  • modifiers
  • has_completed_onboarding_for
  • surveys_opt_in
    boolean
  • heatmaps_opt_in
    boolean
  • flags_persistence_default
    boolean
  • receive_org_level_activity_logs
    boolean
  • business_model
  • conversations_enabled
    boolean
  • conversations_settings
  • logs_settings

Response


Example request

PATCH /api/organizations/:organization_id/projects/: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/organizations/:organization_id/projects/:id/reset_token/\
-d organization="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"name": "string",
"product_description": "string",
"created_at": "2019-08-24T14:15:22Z",
"effective_membership_level": 1,
"has_group_types": true,
"group_types": [
{
"property1": null,
"property2": null
}
],
"live_events_token": "string",
"updated_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"api_token": "string",
"app_urls": [
"string"
],
"slack_incoming_webhook": "string",
"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": 30000,
"session_recording_linked_flag": null,
"session_recording_network_payload_capture_config": null,
"session_recording_masking_config": null,
"session_replay_config": null,
"survey_config": null,
"access_control": true,
"week_start_day": 0,
"primary_dashboard": 0,
"live_events_columns": [
"string"
],
"recording_domains": [
"string"
],
"person_on_events_querying_enabled": "string",
"inject_web_apps": true,
"extra_settings": null,
"modifiers": null,
"default_modifiers": "string",
"has_completed_onboarding_for": null,
"surveys_opt_in": true,
"heatmaps_opt_in": true,
"product_intents": "string",
"flags_persistence_default": true,
"secret_api_token": "string",
"secret_api_token_backup": "string",
"receive_org_level_activity_logs": true,
"business_model": "b2b",
"conversations_enabled": true,
"conversations_settings": null,
"logs_settings": null
}

Update rotate secret token

Projects for the current organization.

Path parameters

  • id
    integer
  • organization_id
    string

Request parameters

  • name
    string
  • product_description
    string
  • app_urls
    array
  • 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_masking_config
  • session_replay_config
  • survey_config
  • access_control
    boolean
  • week_start_day
  • primary_dashboard
    integer
  • live_events_columns
    array
  • recording_domains
    array
  • inject_web_apps
    boolean
  • extra_settings
  • modifiers
  • has_completed_onboarding_for
  • surveys_opt_in
    boolean
  • heatmaps_opt_in
    boolean
  • flags_persistence_default
    boolean
  • receive_org_level_activity_logs
    boolean
  • business_model
  • conversations_enabled
    boolean
  • conversations_settings
  • logs_settings

Response


Example request

PATCH /api/organizations/:organization_id/projects/:id/rotate_secret_token
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/organizations/:organization_id/projects/:id/rotate_secret_token/\
-d organization="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"name": "string",
"product_description": "string",
"created_at": "2019-08-24T14:15:22Z",
"effective_membership_level": 1,
"has_group_types": true,
"group_types": [
{
"property1": null,
"property2": null
}
],
"live_events_token": "string",
"updated_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"api_token": "string",
"app_urls": [
"string"
],
"slack_incoming_webhook": "string",
"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": 30000,
"session_recording_linked_flag": null,
"session_recording_network_payload_capture_config": null,
"session_recording_masking_config": null,
"session_replay_config": null,
"survey_config": null,
"access_control": true,
"week_start_day": 0,
"primary_dashboard": 0,
"live_events_columns": [
"string"
],
"recording_domains": [
"string"
],
"person_on_events_querying_enabled": "string",
"inject_web_apps": true,
"extra_settings": null,
"modifiers": null,
"default_modifiers": "string",
"has_completed_onboarding_for": null,
"surveys_opt_in": true,
"heatmaps_opt_in": true,
"product_intents": "string",
"flags_persistence_default": true,
"secret_api_token": "string",
"secret_api_token_backup": "string",
"receive_org_level_activity_logs": true,
"business_model": "b2b",
"conversations_enabled": true,
"conversations_settings": null,
"logs_settings": null
}

List all roles

Required API key scopes

organization:read

Path parameters

  • organization_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/organizations/:organization_id/roles
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/organizations/:organization_id/roles/

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",
"name": "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"
},
"members": "string",
"is_default": "string"
}
]
}

Create roles

Required API key scopes

organization:write

Path parameters

  • organization_id
    string

Request parameters

  • name
    string

Response


Example request

POST /api/organizations/:organization_id/roles
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/organizations/:organization_id/roles/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "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"
},
"members": "string",
"is_default": "string"
}

Retrieve roles

Required API key scopes

organization:read

Path parameters

  • id
    string
  • organization_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "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"
},
"members": "string",
"is_default": "string"
}

Update roles

Required API key scopes

organization:write

Path parameters

  • id
    string
  • organization_id
    string

Request parameters

  • name
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "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"
},
"members": "string",
"is_default": "string"
}

Delete roles

Required API key scopes

organization:write

Path parameters

  • id
    string
  • organization_id
    string

Example request

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

Example response

Status 204 No response body

List all annotations

Create, Read, Update and Delete annotations. See docs for more information on annotations.

Required API key scopes

annotation:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer
  • search
    string

Response


Example request

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

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,
"content": "string",
"date_marker": "2019-08-24T14:15:22Z",
"creation_type": "USR",
"dashboard_item": 0,
"dashboard_id": 0,
"dashboard_name": "string",
"insight_short_id": "string",
"insight_name": "string",
"insight_derived_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",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"scope": "dashboard_item"
}
]
}

Create annotations

Create, Read, Update and Delete annotations. See docs for more information on annotations.

Required API key scopes

annotation:write

Path parameters

  • project_id
    string

Request parameters

  • content
    string
  • date_marker
    string
  • creation_type
  • dashboard_item
    integer
  • dashboard_id
    integer
  • deleted
    boolean
  • scope

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": 0,
"content": "string",
"date_marker": "2019-08-24T14:15:22Z",
"creation_type": "USR",
"dashboard_item": 0,
"dashboard_id": 0,
"dashboard_name": "string",
"insight_short_id": "string",
"insight_name": "string",
"insight_derived_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",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"scope": "dashboard_item"
}

Retrieve annotations

Create, Read, Update and Delete annotations. See docs for more information on annotations.

Required API key scopes

annotation:read

Path parameters

  • id
    integer
  • project_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"content": "string",
"date_marker": "2019-08-24T14:15:22Z",
"creation_type": "USR",
"dashboard_item": 0,
"dashboard_id": 0,
"dashboard_name": "string",
"insight_short_id": "string",
"insight_name": "string",
"insight_derived_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",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"scope": "dashboard_item"
}

Update annotations

Create, Read, Update and Delete annotations. See docs for more information on annotations.

Required API key scopes

annotation:write

Path parameters

  • id
    integer
  • project_id
    string

Request parameters

  • content
    string
  • date_marker
    string
  • creation_type
  • dashboard_item
    integer
  • dashboard_id
    integer
  • deleted
    boolean
  • scope

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"content": "string",
"date_marker": "2019-08-24T14:15:22Z",
"creation_type": "USR",
"dashboard_item": 0,
"dashboard_id": 0,
"dashboard_name": "string",
"insight_short_id": "string",
"insight_name": "string",
"insight_derived_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",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"scope": "dashboard_item"
}

Delete annotations

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

Required API key scopes

annotation:write

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 405 No response body

List all cohorts

Required API key scopes

cohort:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"description": "string",
"groups": null,
"deleted": true,
"filters": null,
"query": null,
"version": 0,
"pending_version": 0,
"is_calculating": true,
"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",
"last_calculation": "2019-08-24T14:15:22Z",
"errors_calculating": 0,
"last_error_message": "string",
"count": 0,
"is_static": true,
"cohort_type": "static",
"experiment_set": [
0
],
"_create_in_folder": "string",
"_create_static_person_ids": [
"string"
]
}
]
}

Create cohorts

Required API key scopes

cohort:write

Path parameters

  • project_id
    string

Request parameters

  • name
    string
  • description
    string
  • groups
  • deleted
    boolean
  • filters
  • query
  • is_static
    boolean
  • cohort_type
  • _create_in_folder
    string
  • _create_static_person_ids
    array

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": 0,
"name": "string",
"description": "string",
"groups": null,
"deleted": true,
"filters": null,
"query": null,
"version": 0,
"pending_version": 0,
"is_calculating": true,
"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",
"last_calculation": "2019-08-24T14:15:22Z",
"errors_calculating": 0,
"last_error_message": "string",
"count": 0,
"is_static": true,
"cohort_type": "static",
"experiment_set": [
0
],
"_create_in_folder": "string",
"_create_static_person_ids": [
"string"
]
}
Next page →

Community questions

Questions about this page? or post a community question.