PostHog Environments API

The environments API from PostHog — 15 operation(s) for environments.

GitHub OpenAPI

Operations 23

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/projects/{project_id}/environments/ List environments in a project · Environments list #
Ask an LLM
“What environments exist in my PostHog project?”
“Can I page through all the environments of a project?”
Tell an agent
List environments for project {project_id}.
Show {limit} environments of project {project_id} starting at {offset}.
POST /api/projects/{project_id}/environments/ Create an environment in a project · Environments create #
Ask an LLM
“How do I add a new environment to a project?”
“What details are required to create an environment?”
Tell an agent
Create environment {name} in project {project_id}.
Add a new environment to project {project_id} with API token {api_token}.
GET /api/projects/{project_id}/environments/{id}/ Get an environment in a project · Environments retrieve #
Ask an LLM
“What are the settings of one environment in my project?”
“Can I fetch a single environment by its ID?”
Tell an agent
Get environment {id} in project {project_id}.
Show the configuration of environment {id} of project {project_id}.
PUT /api/projects/{project_id}/environments/{id}/ Replace an environment's settings · Environments update #
Ask an LLM
“How do I overwrite all settings of an environment?”
“Can I fully replace an environment's configuration?”
Tell an agent
Replace environment {id} in project {project_id} with name {name}.
Overwrite every setting of environment {id} of project {project_id}.
PATCH /api/projects/{project_id}/environments/{id}/ Change some settings of an environment · Environments partial update #
Ask an LLM
“How do I turn on session recording for just one environment?”
“Can I change only a few environment settings without resending the rest?”
Tell an agent
Set session recording on for environment {id} in project {project_id}.
Change the timezone of environment {id} of project {project_id} to {timezone}.
DELETE /api/projects/{project_id}/environments/{id}/ Delete an environment from a project · Environments destroy #
Ask an LLM
“How do I remove an environment from a project?”
“Can I delete an environment I no longer need?”
Tell an agent destructive · confirm first
Delete environment {id} from project {project_id}.
Remove the environment {id} in project {project_id}.
GET /api/projects/{project_id}/environments/{id}/activity/ Get an environment's activity log · Environments activity retrieve #
Ask an LLM
“What has happened in a particular environment recently?”
“Can I see the activity feed for one environment?”
Tell an agent
Show the activity log for environment {id} in project {project_id}.
List recent activity in environment {id} of project {project_id}.
PATCH /api/projects/{project_id}/environments/{id}/add_product_intent/ Add a product intent to an environment · Environments add product intent partial update #
Ask an LLM
“How do I add a product intent to a team's environment?”
“Can I attach a product intent to an environment that already has one?”
Tell an agent
Add product intent {intent} to environment {id} in project {project_id}.
Attach the {intent} product intent to team environment {id}.
PATCH /api/projects/{project_id}/environments/{id}/complete_product_onboarding/ Mark an environment's onboarding as complete · Environments complete product onboarding partial update #
Ask an LLM
“How do I mark a team environment's onboarding as finished?”
“Can I finish the onboarding setup for an environment?”
Tell an agent
Complete onboarding for environment {id} in project {project_id}.
Mark team environment {id} as onboarding complete.
GET /api/projects/{project_id}/environments/{id}/default_evaluation_contexts/ Get default evaluation contexts for an environment · Environments default evaluation contexts retrieve #
Ask an LLM
“What default evaluation contexts are set on a team environment?”
“Can I read the default evaluation contexts of an environment?”
Tell an agent
Show the default evaluation contexts for environment {id} in project {project_id}.
List default evaluation contexts on team environment {id}.
POST /api/projects/{project_id}/environments/{id}/default_evaluation_contexts/ Create a default evaluation context for an environment · Environments default evaluation contexts create #
Ask an LLM
“How do I create a default evaluation context for a team environment?”
“Can I set default evaluation contexts on an environment?”
Tell an agent
Create default evaluation context {name} on environment {id} in project {project_id}.
Add default evaluation context {name} to team environment {id}.
DELETE /api/projects/{project_id}/environments/{id}/default_evaluation_contexts/ Delete an environment's default evaluation context · Environments default evaluation contexts destroy #
Ask an LLM
“How do I remove the default evaluation context from an environment?”
“Can I delete a default evaluation context on a team environment?”
Tell an agent destructive · confirm first
Delete the default evaluation context from environment {id} in project {project_id}.
Remove default evaluation context on team environment {id}.
GET /api/projects/{project_id}/environments/{id}/default_release_conditions/ Get default release conditions for an environment · Environments default release conditions retrieve #
Ask an LLM
“What default release conditions apply to new flags in an environment?”
“Can I read the default release conditions of an environment?”
Tell an agent
Show default release conditions for environment {id} in project {project_id}.
List default release conditions on team environment {id}.
PUT /api/projects/{project_id}/environments/{id}/default_release_conditions/ Update default release conditions for new flags · Environments default release conditions update #
Ask an LLM
“How can I change the default release conditions applied to new feature flags?”
“Can I update what conditions new flags start with in a team?”
Tell an agent
Update the default release conditions for new flags in environment {id} of project {project_id}.
Change which release conditions new feature flags get by default in team {id}, project {project_id}.
PATCH /api/projects/{project_id}/environments/{id}/delete_secret_token_backup/ Delete the backup secret API token · Environments delete secret token backup partial update #
Ask an LLM
“How do I get rid of the backup secret token on an environment?”
“Can I remove the old secret API token left over after a rotation?”
Tell an agent destructive · confirm first
Delete the backup secret token for environment {id} in project {project_id}.
Remove the secondary secret API token from team {id} under project {project_id}.
GET /api/projects/{project_id}/environments/{id}/event_ingestion_restrictions/ Get event ingestion restrictions for an environment · Environments event ingestion restrictions retrieve #
Ask an LLM
“Are there any event ingestion restrictions on this environment?”
“What limits are placed on events sent to a team?”
Tell an agent
Show the event ingestion restrictions for environment {id} in project {project_id}.
Check ingestion restrictions applied to team {id} under project {project_id}.
GET /api/projects/{project_id}/environments/{id}/experiments_config/ Get experiment configuration for an environment · Environments experiments config retrieve #
Ask an LLM
“What experiment settings are configured for this environment?”
“Can I read the experiments config of a team?”
Tell an agent
Show the experiments config for environment {id} in project {project_id}.
Read the experiment configuration of team {id} under project {project_id}.
PATCH /api/projects/{project_id}/environments/{id}/experiments_config/ Update experiment configuration for an environment · Environments experiments config partial update #
Ask an LLM
“Can I change the experiment configuration of an environment?”
“What's the way to edit a team's experiments settings?”
Tell an agent
Update the experiments config for environment {id} in project {project_id}.
Edit the experiment settings of team {id} under project {project_id}.
POST /api/projects/{project_id}/environments/{id}/generate_conversations_public_token/ Generate a public token for conversations · Environments generate conversations public token create #
Ask an LLM
“How do I get a public conversation token for my production project?”
“Can I generate a conversations token for a project I am not a member of?”
Tell an agent
Generate a public conversations token for project {project_id} environment {id}.
Create a conversations public token for project {project_id} in team {id}.
GET /api/projects/{project_id}/environments/{id}/is_generating_demo_data/ Check if demo data is being generated · Environments is generating demo data retrieve #
Ask an LLM
“Is the demo data generation still in progress for my project?”
“Can I poll whether demo data for an environment has finished?”
Tell an agent
Check if demo data is being generated for project {project_id} environment {id}.
Poll the demo generation status for project {project_id} team {id}.
PATCH /api/projects/{project_id}/environments/{id}/reset_token/ Reset a project's public API token · Environments reset token partial update #
Ask an LLM
“How do I reset my project's public API token without changing the secret token?”
“Can I rotate only the public token and keep the secret token?”
Tell an agent destructive · confirm first
Reset the public API token for project {project_id} environment {id}.
Rotate just the public token of project {project_id} team {id}, leaving the secret token.
PATCH /api/projects/{project_id}/environments/{id}/rotate_secret_token/ Rotate a project's secret API token · Environments rotate secret token partial update #
Ask an LLM
“How do I rotate my project's secret API token?”
“Can I replace the secret token of an environment with a new one?”
Tell an agent destructive · confirm first
Rotate the secret API token for project {project_id} environment {id}.
Generate a new secret token for project {project_id} team {id}.
GET /api/projects/{project_id}/environments/{id}/settings_as_of/ View environment settings as of a past time · Environments settings as of retrieve #
Ask an LLM
“What were my environment's settings at an earlier point in time?”
“Can I look back at how a team was configured on a specific past date?”
Tell an agent
Show the historical settings of environment {id} in project {project_id} as they were at a past timestamp.
Look up what team {id} in project {project_id} had configured at an earlier date.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/posthog:posthog-environments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

posthog-environments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PostHog Environments API
  version: 1.0.0
  description: ''
tags:


# --- truncated at 32 KB (95 KB total) ---
# Full source: https://artifacts.apis.io/posthog/openapi/posthog-environments-api-openapi.yml