Environments-18

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

Endpoints

GET
GET
GET
GET
GET
GET
GET
GET
GET
GET
POST
POST
GET
POST
GET

Retrieve integrations github repos

Required API key scopes

integration:read

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations google accessible accounts

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations google conversion actions

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations jira

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations linear teams

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations linkedin ads accounts

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations linkedin ads conversion rules

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations twilio phone numbers

Path parameters

  • id
    integer
  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve integrations authorize

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve llm analytics evaluation config

Get the evaluation config for this team

Required API key scopes

llm_provider_key:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve llm analytics evaluation config

Get the evaluation config for this team

Required API key scopes

llm_provider_key:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Create llm analytics evaluation config set active key

Set the active provider key for evaluations

Path parameters

  • project_id
    string

Example request

POST /api/environments/:project_id/llm_analytics/evaluation_config/set_active_key
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/llm_analytics/evaluation_config/set_active_key/

Example response

Status 200 No response body

Create llm analytics evaluation config set active key

Set the active provider key for evaluations

Path parameters

  • project_id
    string

Example request

POST /api/environments/:project_id/llm_analytics/evaluation_config/set_active_key
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/llm_analytics/evaluation_config/set_active_key/

Example response

Status 200 No response body

Create llm analytics evaluation summary

Generate an AI-powered summary of evaluation results.

This endpoint analyzes evaluation runs and identifies patterns in passing and failing evaluations, providing actionable recommendations.

Data is fetched server-side by evaluation ID to ensure data integrity.

Use Cases:

  • Understand why evaluations are passing or failing
  • Identify systematic issues in LLM responses
  • Get recommendations for improving response quality
  • Review patterns across many evaluation runs at once

Required API key scopes

llm_analytics:write

Path parameters

  • project_id
    string

Request parameters

  • evaluation_id
    string
  • filter
    Default: all
  • generation_ids
    array
  • force_refresh
    boolean
    Default: false

Response


Example request

POST /api/environments/:project_id/llm_analytics/evaluation_summary
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/llm_analytics/evaluation_summary/\
-d evaluation_id="string"

Example response

Status 200
RESPONSE
{
"overall_assessment": "Evaluations show generally good quality with some factual accuracy issues.",
"pass_patterns": [
{
"title": "Clear Communication",
"description": "Responses consistently provided well-structured information",
"frequency": "common",
"example_reasoning": "Good formatting and clear explanation",
"example_generation_ids": [
"gen_abc123",
"gen_ghi789"
]
}
],
"fail_patterns": [
{
"title": "Factual Errors",
"description": "Some responses contained inaccurate information",
"frequency": "occasional",
"example_reasoning": "Response contained factual errors",
"example_generation_ids": [
"gen_def456"
]
}
],
"na_patterns": [],
"recommendations": [
"Implement fact-checking for critical claims",
"Add source citations where applicable"
],
"statistics": {
"total_analyzed": 3,
"pass_count": 2,
"fail_count": 1,
"na_count": 0
}
}
Status 400
Status 403
Status 404
Status 500

Retrieve llm analytics models

List available models for a provider.

Required API key scopes

llm_provider_key:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Retrieve llm analytics models

List available models for a provider.

Required API key scopes

llm_provider_key:read

Path parameters

  • project_id
    string

Example request

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

Example response

Status 200 No response body

Create llm analytics provider key validations

Validate LLM provider API keys without persisting them

Required API key scopes

llm_provider_key:write

Path parameters

  • project_id
    string

Example request

POST /api/environments/:project_id/llm_analytics/provider_key_validations
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/llm_analytics/provider_key_validations/

Example response

Status 201 No response body

Create llm analytics provider key validations

Validate LLM provider API keys without persisting them

Required API key scopes

llm_provider_key:write

Path parameters

  • project_id
    string

Example request

POST /api/environments/:project_id/llm_analytics/provider_key_validations
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/llm_analytics/provider_key_validations/

Example response

Status 201 No response body

List all llm analytics provider keys

Required API key scopes

llm_provider_key:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"provider": "openai",
"name": "string",
"state": "unknown",
"error_message": "string",
"api_key": "string",
"api_key_masked": "string",
"set_as_active": false,
"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"
},
"last_used_at": "2019-08-24T14:15:22Z"
}
]
}

List all llm analytics provider keys

Required API key scopes

llm_provider_key:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"provider": "openai",
"name": "string",
"state": "unknown",
"error_message": "string",
"api_key": "string",
"api_key_masked": "string",
"set_as_active": false,
"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"
},
"last_used_at": "2019-08-24T14:15:22Z"
}
]
}
Next page →

Community questions

Questions about this page? or post a community question.