PostHog Experiments API

The experiments API from PostHog — 18 operation(s) for experiments.

GitHub OpenAPI
Business capability
A/B Test Execution BC-4280.50

Operations 22

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}/experiments/ List experiments in a project · Experiments list #
Ask an LLM
“Which A/B experiments are running in my project?”
“Can I filter experiments by status or creator?”
Tell an agent
List experiments in project {project_id}.
Show experiments in project {project_id} with status {status}.
POST /api/projects/{project_id}/experiments/ Create a new experiment · Experiments create #
Ask an LLM
“How do I set up a new A/B experiment with a feature flag?”
“Can I add metrics and variants when creating an experiment?”
Tell an agent
Create experiment {name} with feature flag {feature_flag_key} in project {project_id}.
Create experiment {name} in project {project_id} with metrics {saved_metrics}.
GET /api/projects/{project_id}/experiments/{id}/ Get an experiment's status and results · Experiments retrieve #
Ask an LLM
“What is the current status of a specific experiment?”
“Can I see an experiment's metrics and feature flag?”
Tell an agent
Get experiment {id} in project {project_id}.
Show the results metadata of experiment {id} in project {project_id}.
PUT /api/projects/{project_id}/experiments/{id}/ Replace an experiment's configuration · Experiments update #
Ask an LLM
“How do I change an experiment's metrics or variants in one full update?”
“Can I replace an experiment's whole configuration?”
Tell an agent
Replace experiment {id} in project {project_id} with metrics {saved_metrics}.
Update experiment {id} in project {project_id} with name {name}.
PATCH /api/projects/{project_id}/experiments/{id}/ Change an experiment's name or description · Experiments partial update #
Ask an LLM
“How do I rename an experiment?”
“Can I change an experiment's description without resending everything?”
Tell an agent
Rename experiment {id} in project {project_id} to {name}.
Change the description of experiment {id} in project {project_id} to {description}.
DELETE /api/projects/{project_id}/experiments/{id}/ Delete an experiment (hard delete not allowed) · Experiments destroy #
Ask an LLM
“Can I hard delete an experiment?”
“What happens to an experiment when I delete it?”
Tell an agent destructive · confirm first
Delete experiment {id} in project {project_id}.
Hard delete experiment {id} in project {project_id}.
POST /api/projects/{project_id}/experiments/{id}/archive/ Archive an ended experiment · Experiments archive create #
Ask an LLM
“How do I archive an experiment that has ended?”
“Can I hide an experiment from the list view?”
Tell an agent
Archive experiment {id} in project {project_id}.
Hide ended experiment {id} in project {project_id} by archiving it.
POST /api/projects/{project_id}/experiments/{id}/copy_to_project/ Copy an experiment to another team's project · Experiments copy to project create #
Ask an LLM
“How do I copy an experiment into a different team's project?”
“Can I give a copied experiment a new name and feature flag key?”
Tell an agent
Copy experiment {id} from project {project_id} into team {target_team_id}'s project.
Copy experiment {id} into team {target_team_id}'s project as {name} with flag {feature_flag_key}.
POST /api/projects/{project_id}/experiments/{id}/create_exposure_cohort_for_experiment/ Create an exposure cohort for an experiment · Experiments create exposure cohort for experiment create #
Ask an LLM
“How do I define a cohort of users who can be exposed to an experiment?”
“Can I create an exposure cohort for an experiment before launching it?”
Tell an agent
Create exposure cohort {name} for experiment {id} in project {project_id}.
Define an exposure cohort for experiment {id} in project {project_id} with filters {filters}.
POST /api/projects/{project_id}/experiments/{id}/duplicate/ Duplicate an experiment · Experiments duplicate create #
Ask an LLM
“How do I make a copy of an existing experiment?”
“Can I duplicate an experiment with a new name and feature flag key?”
Tell an agent
Duplicate experiment {id} in project {project_id} as {name} with flag {feature_flag_key}.
Make a copy of experiment {id} in project {project_id}.
POST /api/projects/{project_id}/experiments/{id}/end/ End a running experiment · Experiments end create #
Ask an LLM
“How do I end a running experiment without shipping a variant?”
“Can I set a conclusion on an experiment when I end it?”
Tell an agent
End experiment {id} in project {project_id}.
End experiment {id} in project {project_id} with conclusion {conclusion}.
POST /api/projects/{project_id}/experiments/{id}/launch/ Launch a draft experiment · Experiments launch create #
Ask an LLM
“How do I launch a draft experiment so it starts sending traffic?”
“What does launching an experiment do to its feature flag?”
Tell an agent
Launch experiment {id} in project {project_id}.
Activate the feature flag of experiment {id} in project {project_id}.
POST /api/projects/{project_id}/experiments/{id}/pause/ Pause a running experiment · Experiments pause create #
Ask an LLM
“How do I pause an experiment so it stops sending traffic?”
“What happens to users when an experiment is paused?”
Tell an agent
Pause experiment {id} in project {project_id}.
Deactivate the feature flag of experiment {id} in project {project_id}.
POST /api/projects/{project_id}/experiments/{id}/recalculate_timeseries/ Recalculate an experiment's timeseries results · Experiments recalculate timeseries create #
Ask an LLM
“How do I rebuild the timeseries results behind an experiment?”
“Can I force an experiment's timeseries to be recalculated from scratch?”
Tell an agent
Recalculate the timeseries for experiment {id} in project {project_id}.
Rebuild the timeseries data of experiment {id} in project {project_id} named {name}.
POST /api/projects/{project_id}/experiments/{id}/reset/ Reset an experiment back to draft · Experiments reset create #
Ask an LLM
“How do I reset an experiment so I can change its start and end dates?”
“Does resetting an experiment archive it or clear its conclusion?”
Tell an agent
Reset experiment {id} in project {project_id} back to draft.
Clear the conclusion and dates on experiment {id} in project {project_id}.
POST /api/projects/{project_id}/experiments/{id}/resume/ Resume a paused experiment · Experiments resume create #
Ask an LLM
“How do I restart a paused experiment so users see their original variant again?”
“What happens to exposure tracking when a paused experiment is resumed?”
Tell an agent
Resume experiment {id} in project {project_id}.
Reactivate the feature flag for experiment {id} in project {project_id}.
POST /api/projects/{project_id}/experiments/{id}/ship_variant/ Ship a variant to 100% of users · Experiments ship variant create #
Ask an LLM
“How do I roll out a winning variant to every user?”
“Can I end an experiment and ship a variant in one step?”
Tell an agent
Ship variant {variant_key} of experiment {id} in project {project_id}.
End experiment {id} in project {project_id} and conclude it as {conclusion}.
GET /api/projects/{project_id}/experiments/{id}/timeseries_results/ Get an experiment's timeseries results · Experiments timeseries results retrieve #
Ask an LLM
“What does an experiment's result look like over time?”
“Can I fetch the timeseries for one metric in an experiment?”
Tell an agent
Get the timeseries results for metric {metric_uuid} in experiment {id} of project {project_id}.
Show experiment {id} results in project {project_id} for fingerprint {fingerprint}.
POST /api/projects/{project_id}/experiments/{id}/unarchive/ Restore an archived experiment · Experiments unarchive create #
Ask an LLM
“How do I bring an archived experiment back into the experiment list?”
“Can I unarchive an experiment that is still running?”
Tell an agent
Unarchive experiment {id} in project {project_id}.
Restore archived experiment {id} to the default view in project {project_id}.
GET /api/projects/{project_id}/experiments/eligible_feature_flags/ List feature flags eligible for experiments · Experiments eligible feature flags retrieve #
Ask an LLM
“Which multivariate feature flags can I use for an experiment?”
“What flags are eligible for experiments in my project?”
Tell an agent
List feature flags eligible for experiments in project {project_id}.
Show multivariate flags with at least two variants in project {project_id}.
GET /api/projects/{project_id}/experiments/requires_flag_implementation/ List experiments needing flag implementation · Experiments requires flag implementation retrieve #
Ask an LLM
“Which experiments are waiting on flag implementation?”
“Can I see experiments that still need their feature flag code?”
Tell an agent
List experiments in project {project_id} that require flag implementation.
Show experiments needing flag implementation in project {project_id}.
GET /api/projects/{project_id}/experiments/stats/ Get experiment statistics for a project · Experiments stats retrieve #
Ask an LLM
“What are the overall experiment statistics for my project?”
“Can I see experiment stats across all experiments in a project?”
Tell an agent
Get experiment statistics for project {project_id}.
Show overall experiment stats in project {project_id}.

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-experiments-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-experiments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PostHog Experiments API
  version: 1.0.0
  description: ''
tags:


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