PostHog experiments API

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

Operations 22

GET /api/projects/{project_id}/experiments/ #
POST /api/projects/{project_id}/experiments/ #
GET /api/projects/{project_id}/experiments/{id}/ #
PUT /api/projects/{project_id}/experiments/{id}/ #
PATCH /api/projects/{project_id}/experiments/{id}/ #
DELETE /api/projects/{project_id}/experiments/{id}/ #
POST /api/projects/{project_id}/experiments/{id}/archive/ #
POST /api/projects/{project_id}/experiments/{id}/copy_to_project/ #
POST /api/projects/{project_id}/experiments/{id}/create_exposure_cohort_for_experiment/ #
POST /api/projects/{project_id}/experiments/{id}/duplicate/ #
POST /api/projects/{project_id}/experiments/{id}/end/ #
POST /api/projects/{project_id}/experiments/{id}/launch/ #
POST /api/projects/{project_id}/experiments/{id}/pause/ #
POST /api/projects/{project_id}/experiments/{id}/recalculate_timeseries/ #
POST /api/projects/{project_id}/experiments/{id}/reset/ #
POST /api/projects/{project_id}/experiments/{id}/resume/ #
POST /api/projects/{project_id}/experiments/{id}/ship_variant/ #
GET /api/projects/{project_id}/experiments/{id}/timeseries_results/ #
POST /api/projects/{project_id}/experiments/{id}/unarchive/ #
GET /api/projects/{project_id}/experiments/eligible_feature_flags/ #
GET /api/projects/{project_id}/experiments/requires_flag_implementation/ #
GET /api/projects/{project_id}/experiments/stats/ #

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-experiments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. 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 actions Experiments API
  version: 1.0.0
  description: ''
servers:
- url: https://app.posthog.com/api
  description: Base URL declared by the provider in apis.yml (roadmap#122).
tags:
- name: experiments
paths:
  /api/projects/{project_id}/experiments/:
    get:
      operationId: experiments_list
      description: List experiments for the current project. Supports filtering by status and archival state.
      parameters:
      - in: query
        name: archived
        schema:
          type: boolean
        description: Filter by archived state. Defaults to non-archived experiments only.
      - in: query
        name: created_by_id
        schema:
          type: integer
        description: Filter to experiments created by the given user ID.
      - in: query
        name: feature_flag_id
        schema:
          type: integer
        description: Filter to experiments linked to the given feature flag ID.
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: query
        name: order
        schema:
          type: string
        description: Field to order by. Prefix with '-' for descending. Allowlisted fields include name, created_at, updated_at, start_date, end_date, duration, and status.
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: query
        name: search
        schema:
          type: string
        description: Free-text search applied to the experiment name (case-insensitive).
      - in: query
        name: status
        schema:
          type: string
          enum:
          - all
          - complete
          - draft
          - paused
          - running
          - stopped
        description: 'Filter by experiment status. "running" and "paused" are mutually exclusive: "running" returns launched experiments with an active feature flag, "paused" returns launched experiments whose feature flag is deactivated. "complete" is an alias for "stopped". "all" disables status filtering.'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedExperimentList'
          description: ''
      x-explicit-tags:
      - experiments
    post:
      operationId: experiments_create
      description: Create a new experiment in draft status with optional metrics.
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experiment'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/:
    get:
      operationId: experiments_retrieve
      description: Retrieve a single experiment by ID, including its current status, metrics, feature flag, and results metadata.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
    put:
      operationId: experiments_update
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experiment'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
    patch:
      operationId: experiments_partial_update
      description: 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.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedExperiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedExperiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedExperiment'
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
    delete:
      operationId: experiments_destroy
      description: Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '405':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/archive/:
    post:
      operationId: experiments_archive_create
      description: '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 or has not ended yet.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/copy_to_project/:
    post:
      operationId: experiments_copy_to_project_create
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CopyExperimentToProject'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CopyExperimentToProject'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CopyExperimentToProject'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/create_exposure_cohort_for_experiment/:
    post:
      operationId: experiments_create_exposure_cohort_for_experiment_create
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experiment'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/duplicate/:
    post:
      operationId: experiments_duplicate_create
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experiment'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/end/:
    post:
      operationId: experiments_end_create
      description: "End a running experiment without shipping a variant.\n\nSets end_date to now and marks the experiment as stopped. The feature\nflag is NOT modified — users continue to see their assigned variants\nand exposure events ($feature_flag_called) continue to be recorded.\nHowever, only data up to end_date is included in experiment results.\n\nUse this when:\n\n- You want to freeze the results window without changing which variant\n  users see.\n- A variant was already shipped manually via the feature flag UI and\n  the experiment just needs to be marked complete.\n\nThe end_date can be adjusted after ending via PATCH if it needs to be\nbackdated (e.g. to match when the flag was actually paused).\n\nOther options:\n- Use ship_variant to end the experiment AND roll out a single variant to 100%% of users.\n- Use pause to deactivate the flag without ending the experiment (stops variant assignment but does not freeze results).\n\nReturns 400 if the experiment is not running."
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EndExperiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EndExperiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EndExperiment'
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/launch/:
    post:
      operationId: experiments_launch_create
      description: 'Launch a draft experiment.


        Validates the experiment is in draft state, activates its linked feature flag,

        sets start_date to the current server time, and transitions the experiment to running.

        Returns 400 if the experiment has already been launched or if the feature flag

        configuration is invalid (e.g. missing "control" variant or fewer than 2 variants).'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/pause/:
    post:
      operationId: experiments_pause_create
      description: '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 no new exposure events are recorded (i.e.

        $feature_flag_called is not fired).

        Returns 400 if the experiment is not running or is already paused.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/recalculate_timeseries/:
    post:
      operationId: experiments_recalculate_timeseries_create
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experiment'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/reset/:
    post:
      operationId: experiments_reset_create
      description: '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 collected events still exist but won''t be included in

        results unless the start date is manually adjusted after re-launch.


        Returns 400 if the experiment is already in draft state.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/resume/:
    post:
      operationId: experiments_resume_create
      description: '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 exposure tracking resumes.

        Returns 400 if the experiment is not running or is not paused.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/ship_variant/:
    post:
      operationId: experiments_ship_variant_create
      description: '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 preserved so the change can be

        rolled back by deleting the auto-added release condition in the feature flag UI.


        Can be called on both running and stopped experiments. If the experiment is

        still running, it will also be ended (end_date set and status marked as stopped).

        If the experiment has already ended, only the flag is rewritten - this supports

        the "end first, ship later" workflow.


        If an approval policy requires review before changes on the flag take effect,

        the API returns 409 with a change_request_id. The experiment is NOT ended until

        the change request is approved and the user retries.


        Returns 400 if the experiment is in draft state, the variant_key is not found

        on the flag, or the experiment has no linked feature flag.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShipVariant'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ShipVariant'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ShipVariant'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/timeseries_results/:
    get:
      operationId: experiments_timeseries_results_retrieve
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - in: query
        name: fingerprint
        schema:
          type: string
        description: Fingerprint of the metric configuration. Available alongside metric_uuid on each metric in the experiment's metrics array.
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - in: query
        name: metric_uuid
        schema:
          type: string
        description: UUID of the metric to fetch timeseries for. Available on each metric in the experiment's metrics array.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/{id}/unarchive/:
    post:
      operationId: experiments_unarchive_create
      description: 'Unarchive an archived experiment.


        Restores the experiment to the default list view. Returns 400 if the

        experiment is not currently archived.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this experiment.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/eligible_feature_flags/:
    get:
      operationId: experiments_eligible_feature_flags_retrieve
      description: '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:

        - search: Filter by flag key or name (case insensitive)

        - limit: Number of results per page (default: 20)

        - offset: Pagination offset (default: 0)

        - active: Filter by active status ("true" or "false")

        - created_by_id: Filter by creator user ID

        - order: Sort order field

        - evaluation_runtime: Filter by evaluation runtime

        - has_evaluation_contexts: Filter by presence of evaluation contexts ("true" or "false")'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - feature_flag:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/requires_flag_implementation/:
    get:
      operationId: experiments_requires_flag_implementation_retrieve
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
  /api/projects/{project_id}/experiments/stats/:
    get:
      operationId: experiments_stats_retrieve
      description: 'Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.


        This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator

        on serializer methods and converts them into proper HTTP 409 Conflict responses with

        change request details.'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - experiments
      security:
      - PersonalAPIKeyAuth:
        - experiment:read
      responses:
        '200':
          description: No response body
      x-explicit-tags:
      - experiments
components:
  schemas:
    ExperimentApiEventSource:
      additionalProperties: false
      properties:
        event:
          default: null
          description: Event name, e.g. '$pageview'. Required for EventsNode.
          title: Event
          type:
          - string
          - 'null'
        id:
          default: null
          description: Action ID. Required for ActionsNode.
          title: Id
          type:
          - integer
          - 'null'
        kind:
          $ref: '#/components/schemas/Kind'
        properties:
          default: null
          description: Event property filters to narrow which events are counted.
          title: Properties
          items:
            $ref: '#/components/schemas/EventPropertyFilter'
          type:
          - array
          - 'null'
      required:
      - kind
      title: ExperimentApiEventSource
      type: object
    NullEnum:
      enum:
      - null
    ShipVariant:
      type: object
      properties:
        conclusion:
          description: 'The conclusion of the experiment.


            * `won` - won

            * `lost` - lost

            * `inconclusive` - inconclusive

            * `stopped_early` - stopped_early

            * `invalid` - invalid'
          oneOf:
          - $ref: '#/components/schemas/ConclusionEnum'
          - $ref: '#/components/schemas/NullEnum'
        conclusion_comment:
          type:
          - string
          - 'null'
          description: Optional comment about the experiment conclusion.
        variant_key:
          type: string
          description: The key of the variant to ship to 100% of users.
      required:
      - variant_key
    ExperimentApiMetric:
      additionalProperties: false
      properties:
        completion_event:
          default: null
          description: 'For retention metrics: completion event.'
          allOf:
          - $ref: '#/components/schemas/ExperimentApiEventSource'
        conversion_window:
          default: null
          description: Conversion window duration.
          title: Conversion Window
          type:
          - integer
          - 'null'
        denominator:
          default: null
          description: 'For ratio metrics: denominator source.'
          allOf:
          - $ref: '#/components/schemas/ExperimentApiEventSource'
        goal:
          default: null
          description: Whether higher or lower values indicate success.
          allOf:
          - $ref: '#/components/schemas/ExperimentMetricGoal'
        kind:
          default: ExperimentMetric
          title: Kind
          type: string
          enum:
          - ExperimentMetric
        metric_type:
          $ref: '#/components/schemas/ExperimentMetricType'
        name:
          default: null
          description: Human-readable metric name.
          title: Name
          type:
          - string
          - 'null'
        numerator:
          default: null
          description: 'For ratio metrics: numerator source.'
          allOf:
          - $ref: '#/components/schemas/ExperimentApiEventSource'
        retention_window_end:
          default: null
          title: Retention Window End
          type:
          - integer
          - 'null'
        retention_window_start:
          default: null
          title: Retention Window Start
          type:
          - integer
          - 'null'
        retention_window_unit:
          default: null
          allOf:
          - $ref: '#/components/schemas/FunnelConversionWindowTimeUnit'
        series:
          default: null
          description: 'For funnel metrics: array of EventsNode/ActionsNode steps.'
          title: Series
          items:
            $ref: '#/components/schemas/ExperimentApiEventSource'
          type:
          - array
          - 'null'
        source:
          default: null
          description: 'For mean metrics: event source.'
          allOf:
          - $ref: '#/components/schemas/ExperimentApiEventSource'
        start_event:
          default: null
          description: 'For retention metrics: start event.'
          allOf:
          - $ref: '#/components/schemas/ExperimentApiEventSource'
        start_handling:
          default: null
          allOf:
          - $ref: '#/components/schemas/StartHandling'
        uuid:
          default: null
          description: Unique identifier. Auto-generated if omitted.
          title: Uuid
          type:
          - string
          - 'null'
      required:
      - metric_type
      title: ExperimentApiMetric
      type: object
    ExperimentStatusEnum:
      type: string
      enum:
      - draft
      - running
      - paused
      - stopped
    PaginatedExperimentList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type:
          - string
          - 'null'
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type:
          - string
          - 'null'
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/Experiment'
    ExperimentApiExposureConfig:
      additionalProperties: false
      pro

# --- truncated at 32 KB (56 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/posthog/refs/heads/main/openapi/posthog-experiments-api-openapi.yml