How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

PostHog experiments API

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

PostHog experiments API is one of 139 APIs that PostHog publishes on the APIs.io network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification.

Tagged areas include Experiments. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, a getting-started guide, authentication docs, and an AsyncAPI specification.

This API exposes 22 operations across 18 paths, and defines 29 schemas. It is described by OpenAPI 3.2.0, at version 1.0.0.

Requests are made against a single base URL, https://app.posthog.com/api.

22 operations 18 paths 29 schemas 1 DELETE6 GET1 PATCH13 POST1 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
1.0.0
Base URL
https://app.posthog.com/api
Authentication
HTTP Bearer
Resource Areas
1

Authentication & Security 1

PostHog experiments API declares 1 security scheme for authenticating requests. It accepts HTTP bearer tokens (PersonalAPIKeyAuth).

Paths & Operations 22

Across 18 paths, the API surfaces 22 operations — 1 DELETE, 6 GET, 1 PATCH, 13 POST, 1 PUT. Each is listed below with its method, path, parameters, and response codes.

experiments 22
GET
/api/projects/{project_id}/experiments/
List experiments for the current project. Supports filtering by status and archival state.
experiments_list 9 params → 200
POST
/api/projects/{project_id}/experiments/
Create a new experiment in draft status with optional metrics.
experiments_create 1 param body → 201
GET
/api/projects/{project_id}/experiments/{id}/
Retrieve a single experiment by ID, including its current status, metrics, feature flag, and results metadata.
experiments_retrieve 2 params → 200
PUT
/api/projects/{project_id}/experiments/{id}/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_update 2 params body → 200
PATCH
/api/projects/{project_id}/experiments/{id}/
Update an experiment. Use this to modify experiment properties such as name, description, metrics, variants, and configuration. Metrics can be added, changed and removed at any time.
experiments_partial_update 2 params body → 200
DELETE
/api/projects/{project_id}/experiments/{id}/
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
experiments_destroy 2 params → 405
POST
/api/projects/{project_id}/experiments/{id}/archive/
Archive an ended experiment. Hides the experiment from the default list view. The experiment can be restored at any time by updating archived=false. Returns 400 if the experiment is already archived…
experiments_archive_create 2 params → 200
POST
/api/projects/{project_id}/experiments/{id}/copy_to_project/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_copy_to_project_create 2 params body → 200
POST
/api/projects/{project_id}/experiments/{id}/create_exposure_cohort_for_experiment/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_create_exposure_cohort_for_experiment_create 2 params body → 200
POST
/api/projects/{project_id}/experiments/{id}/duplicate/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_duplicate_create 2 params body → 200
POST
/api/projects/{project_id}/experiments/{id}/end/
End a running experiment without shipping a variant. Sets enddate to now and marks the experiment as stopped. The feature flag is NOT modified — users continue to see their assigned variants and expo…
experiments_end_create 2 params body → 200
POST
/api/projects/{project_id}/experiments/{id}/launch/
Launch a draft experiment. Validates the experiment is in draft state, activates its linked feature flag, sets startdate to the current server time, and transitions the experiment to running. Returns…
experiments_launch_create 2 params → 200
POST
/api/projects/{project_id}/experiments/{id}/pause/
Pause a running experiment. Deactivates the linked feature flag so it is no longer returned by the /decide endpoint. Users fall back to the application default (typically the control experience), and…
experiments_pause_create 2 params → 200
POST
/api/projects/{project_id}/experiments/{id}/recalculate_timeseries/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_recalculate_timeseries_create 2 params body → 200
POST
/api/projects/{project_id}/experiments/{id}/reset/
Reset an experiment back to draft state. Clears start/end dates, conclusion, and archived flag. The feature flag is left unchanged — users continue to see their assigned variants. Previously collecte…
experiments_reset_create 2 params → 200
POST
/api/projects/{project_id}/experiments/{id}/resume/
Resume a paused experiment. Reactivates the linked feature flag so it is returned by /decide again. Users are re-bucketed deterministically into the same variants they had before the pause, and expos…
experiments_resume_create 2 params → 200
POST
/api/projects/{project_id}/experiments/{id}/ship_variant/
Ship a variant to 100% of users and (optionally) end the experiment. Rewrites the feature flag so that the selected variant is served to everyone. Existing release conditions (flag groups) are preser…
experiments_ship_variant_create 2 params body → 200
GET
/api/projects/{project_id}/experiments/{id}/timeseries_results/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_timeseries_results_retrieve 4 params → 200
POST
/api/projects/{project_id}/experiments/{id}/unarchive/
Unarchive an archived experiment. Restores the experiment to the default list view. Returns 400 if the experiment is not currently archived.
experiments_unarchive_create 2 params → 200
GET
/api/projects/{project_id}/experiments/eligible_feature_flags/
Returns a paginated list of feature flags eligible for use in experiments. Eligible flags must: - Be multivariate with at least 2 variants - Have "control" as the first variant key Query parameters:…
experiments_eligible_feature_flags_retrieve 1 param → 200
GET
/api/projects/{project_id}/experiments/requires_flag_implementation/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_requires_flag_implementation_retrieve 1 param → 200
GET
/api/projects/{project_id}/experiments/stats/
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers. This mixin intercepts ApprovalRequired exceptions raised by the @approvalgate decorator on serializer methods and…
experiments_stats_retrieve 1 param → 200

Schemas 29

The contract defines 29 schemas that model the data the API accepts and returns. The most detailed are PatchedExperiment (36 properties), Experiment (36 properties), ExperimentApiMetric (16 properties), UserBasic (9 properties). Each schema is shown below with its type and property counts.

ExperimentApiEventSource
object
4 properties 1 required
NullEnum
ShipVariant
object
3 properties 1 required
ExperimentApiMetric
object
16 properties 1 required
ExperimentStatusEnum
string
PaginatedExperimentList
object
4 properties 2 required
ExperimentApiExposureConfig
object
3 properties 2 required
ExperimentApiExposureCriteria
object
2 properties
ConclusionEnum
string
won - won lost - lost inconclusive - inconclusive stoppedearly - stoppedearly invalid - invalid
ExperimentVariant
object
4 properties 1 required
EventPropertyFilter
object
5 properties 1 required
ExperimentHoldout
object
7 properties 5 required
PropertyOperator
string
EndExperiment
object
2 properties
ExperimentMetricGoal
string
PatchedExperiment
object
Mixin for serializers to add user access control fields
36 properties
ExperimentMetricType
string
ExperimentToSavedMetric
object
7 properties 6 required
UserBasic
object
9 properties 4 required
BlankEnum
ExperimentTypeEnum
string
web - web product - product
RoleAtOrganizationEnum
string
engineering - Engineering data - Data product - Product Management founder - Founder leadership - Leadership marketing - Marketing sales - Sales / Success othe…
Experiment
object
Mixin for serializers to add user access control fields
36 properties 12 required
FunnelConversionWindowTimeUnit
string
StartHandling
string
Kind
string
CopyExperimentToProject
object
3 properties 1 required
_ExperimentApiMetricsList
array
List wrapper for OpenAPI schema generation — the field stores an array of metrics.
ExperimentParameters
object
3 properties

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

posthog-experiments-api-openapi.yml Raw ↑

Other APIs PostHog publishes across the network.

PostHog Capture API
PostHog Query API
PostHog Persons API
PostHog Feature Flags API
PostHog Experiments API
PostHog Insights API
PostHog Cohorts API
PostHog Annotations API
PostHog actions API
PostHog activity_log API
PostHog activity_logs API
PostHog advanced_activity_logs API
Where this information came from

This is an independent, third-party profile of PostHog experiments API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.