Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Experiments

Manage workspace-scoped Experiments.

List Experiments

get
/v4/experiments

Returns a paginated list of Experiments in the specified project workspace. Defaults to active experiments (status defaults to [ACTIVE]). Query parent_type is required. Optional environment_id filters to one environment. Optional parent_name filters by parent name for that type (Feature Flag, AI Config, or Config). Unknown or mismatched parent_name returns 404. name is the experiment title. parent_type=CONFIG returns 404 in v1. Warehouse-native experiments are not returned in v1.

Authorizations
x-api-keystringRequired

Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.

Query parameters
account_idstring · max: 128Required

Harness account identifier. Required on all endpoints.

Example: {{accountId}}Pattern: ^[-_A-Za-z0-9]+$
organization_identifierstring · max: 128Required

Harness organization identifier.

Example: defaultPattern: ^[-_A-Za-z0-9]+$
project_identifierstring · max: 128Required

Harness project identifier.

Example: my_projectPattern: ^[-_A-Za-z0-9]+$
parent_typestring · enumRequired

Kind of parent the experiment runs on. CONFIG and AI_CONFIG are separate types. Warehouse-native experiments are not a parent type; they use assignmentSource on this same resource when implemented.

Example: FEATURE_FLAGPossible values:
environment_idstring · uuid · max: 128Optional

Filter to experiments assigned in this environment.

Example: ad2eb8f0-9c3a-11ed-873c-e234abaad319Pattern: ^[-_A-Za-z0-9]+$
parent_namestring · max: 100Optional

Filter to this parent name. When parent_type is FEATURE_FLAG, this is a Feature Flag name; when AI_CONFIG, an AI Config name; when CONFIG, a Config name. Unknown name, or a name that is not that parent kind, returns 404. name is still the experiment title.

Example: checkout-flagPattern: ^[A-Za-z][-_A-Za-z0-9]*$
namestring · max: 250Optional

Filter by experiment name. Used with match_type.

Example: checkout-experiment
match_typestring · enumOptional

How name is matched. Ignored when name is omitted.

Default: containsExample: containsPossible values:
tagsstring[]Optional

Filter to experiments that have any of the specified tags (by tag name).

limitinteger · min: 1 · max: 100Optional

Number of items to return per page. Defaults to 100, maximum 100.

Default: 100Example: 100
offsetintegerOptional

Number of items to skip before the first returned result. Defaults to 0.

Default: 0Example: 0
Responses
200

OK — paginated list of experiments returned.

application/json

Paginated list of Experiments matching the query.

limitintegerRequired

The page size used for this response.

Example: 100
offsetintegerRequired

The number of items skipped before the first result.

Example: 0
totalCountintegerRequired

Total number of experiments matching the query.

Example: 42
get/v4/experiments
GET /fme/api/v4/experiments?account_id={{accountId}}&organization_identifier=default&project_identifier=my_project&parent_type=FEATURE_FLAG HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "type": "EXPERIMENT",
      "id": "01JAFXNTQHH8QTPTWYSG8H04Y5",
      "parent": {
        "type": "FEATURE_FLAG",
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "name": "checkout-flag"
      },
      "name": "checkout-experiment",
      "description": null,
      "hypothesis": "Checkout conversion increases with treatment on.",
      "environment": {
        "id": "ad2eb8f0-9c3a-11ed-873c-e234abaad319",
        "name": "Production"
      },
      "trafficType": {
        "id": "a707c5af-94c1-4ca1-99dc-f0e72981c9ec",
        "name": "user"
      },
      "startAt": "2025-06-01T12:00:00Z",
      "endAt": "2025-07-01T12:00:00Z",
      "baselineTreatment": "off",
      "comparisonTreatments": [
        "on"
      ],
      "keyMetrics": [
        {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567892",
          "name": "conversion"
        }
      ],
      "supportingMetrics": [],
      "tags": [
        {
          "id": "checkout",
          "type": "TAG",
          "name": "checkout"
        }
      ],
      "owners": [
        {
          "type": "USER",
          "id": "xM5qi75eQYmdgJYfwNoHEQ"
        }
      ],
      "status": "ACTIVE",
      "createdAt": "2025-06-01T12:00:00Z",
      "modifiedAt": "2025-06-15T09:30:00Z"
    }
  ],
  "limit": 100,
  "offset": 0,
  "totalCount": 1
}

Create an Experiment

post
/v4/experiments

Creates a new Experiment in the specified project workspace. Requires environment_id. The parent must exist in that environment (404 if missing). parent.type CONFIG returns 404 in v1. Duplicate name returns 409. Do not send assignmentSource (400 if present). The server infers or creates the cloud assignment source for the project and parent.type.

Authorizations
x-api-keystringRequired

Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.

Query parameters
account_idstring · max: 128Required

Harness account identifier. Required on all endpoints.

Example: {{accountId}}Pattern: ^[-_A-Za-z0-9]+$
organization_identifierstring · max: 128Required

Harness organization identifier.

Example: defaultPattern: ^[-_A-Za-z0-9]+$
project_identifierstring · max: 128Required

Harness project identifier.

Example: my_projectPattern: ^[-_A-Za-z0-9]+$
environment_idstring · uuid · max: 128Required

Environment the experiment is assigned in.

Example: ad2eb8f0-9c3a-11ed-873c-e234abaad319Pattern: ^[-_A-Za-z0-9]+$
Body

Request body for creating a new Experiment. parent.type plus parent.id and/or parent.name are required. Do not send assignmentSource (400 if present).

namestring · min: 2 · max: 250Required

Unique experiment name within the project.

Example: checkout-experimentPattern: ^[a-zA-Z][-_a-zA-Z0-9]+$
descriptionstring · max: 250Optional

Human-readable description of this experiment.

hypothesisstring · max: 500Optional

Hypothesis this experiment is testing.

rulestringOptional

Targeting-rule label to scope this experiment's results to (e.g. "default rule" or a specific targeting rule name on the parent flag). Omit to use the experiment's default rule scope.

Example: default rule
startAtstring · date-timeRequired

ISO-8601 timestamp when the experiment starts.

Example: 2025-06-01T12:00:00Z
endAtstring · date-timeRequired

ISO-8601 timestamp when the experiment ends.

Example: 2025-07-01T12:00:00Z
baselineTreatmentstringRequired

Treatment name. Must start with a letter or digit; remaining characters may be letters, digits, hyphens, underscores, or periods.

Example: onPattern: ^[a-zA-Z0-9][-_\.a-zA-Z0-9]*$
comparisonTreatmentsstring[] · min: 1Required

Comparison treatments (not including baselineTreatment).

Example: on
keyMetricsstring · uuid[]Optional

Metric ids to set as key metrics. Omit for none.

Example: ["a1b2c3d4-e5f6-7890-abcd-ef1234567892"]
supportingMetricsstring · uuid[]Optional

Metric ids to set as supporting metrics. Omit for none.

Responses
201

Created — the experiment was successfully created.

application/json

Experiment mutation response envelope. Returned by create and update: the resulting entity together with the OPA governance result. Experiments are not a governed entity type, so governance is always present with status: NONE and empty details (no policy evaluation occurs); the envelope is kept for response-shape consistency with other v4 resources.

post/v4/experiments
POST /fme/api/v4/experiments?account_id={{accountId}}&organization_identifier=default&project_identifier=my_project&environment_id=ad2eb8f0-9c3a-11ed-873c-e234abaad319 HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 381

{
  "parent": {
    "type": "FEATURE_FLAG",
    "name": "checkout-flag"
  },
  "name": "checkout-experiment",
  "hypothesis": "Checkout conversion increases with treatment on.",
  "startAt": "2025-06-01T12:00:00Z",
  "endAt": "2025-07-01T12:00:00Z",
  "baselineTreatment": "off",
  "comparisonTreatments": [
    "on"
  ],
  "keyMetrics": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567892"
  ],
  "owners": [
    {
      "type": "USER",
      "id": "xM5qi75eQYmdgJYfwNoHEQ"
    }
  ]
}
{
  "entity": {
    "type": "EXPERIMENT",
    "id": "01JAFXNTQHH8QTPTWYSG8H04Y5",
    "parent": {
      "type": "FEATURE_FLAG",
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "checkout-flag"
    },
    "name": "checkout-experiment",
    "description": null,
    "hypothesis": "Checkout conversion increases with treatment on.",
    "environment": {
      "id": "ad2eb8f0-9c3a-11ed-873c-e234abaad319",
      "name": "Production"
    },
    "trafficType": {
      "id": "a707c5af-94c1-4ca1-99dc-f0e72981c9ec",
      "name": "user"
    },
    "startAt": "2025-06-01T12:00:00Z",
    "endAt": "2025-07-01T12:00:00Z",
    "baselineTreatment": "off",
    "comparisonTreatments": [
      "on"
    ],
    "keyMetrics": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567892",
        "name": "conversion"
      }
    ],
    "supportingMetrics": [],
    "tags": [
      {
        "id": "checkout",
        "type": "TAG",
        "name": "checkout"
      }
    ],
    "owners": [
      {
        "type": "USER",
        "id": "xM5qi75eQYmdgJYfwNoHEQ"
      }
    ],
    "status": "ACTIVE",
    "createdAt": "2025-06-01T12:00:00Z",
    "modifiedAt": "2025-06-01T12:00:00Z"
  },
  "governance": {
    "status": "NONE",
    "details": []
  }
}

Get an Experiment

get
/v4/experiments/{experiment-id}

Returns a single Experiment by its system-assigned identifier. Unlike list, this endpoint returns the experiment regardless of lifecycle status (ACTIVE, PAUSED, ARCHIVED, or COMPLETED). CONFIG and warehouse-native experiments return 404 in v1. assignmentSource is omitted.

Authorizations
x-api-keystringRequired

Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.

Path parameters
experiment-idstring · ulid · max: 128Required

The system-assigned identifier (ULID) of the experiment.

Example: 01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Query parameters
account_idstring · max: 128Required

Harness account identifier. Required on all endpoints.

Example: {{accountId}}Pattern: ^[-_A-Za-z0-9]+$
organization_identifierstring · max: 128Required

Harness organization identifier.

Example: defaultPattern: ^[-_A-Za-z0-9]+$
project_identifierstring · max: 128Required

Harness project identifier.

Example: my_projectPattern: ^[-_A-Za-z0-9]+$
Responses
200

OK — experiment returned.

application/json

A workspace-scoped Experiment.

typestring · enumRequired

Resource type discriminator. Always EXPERIMENT.

Possible values:
idstring · ulidRequired

Unique system-assigned identifier for the experiment. Use this as the path parameter in subsequent requests.

Example: 01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
namestring · min: 2 · max: 250Required

Unique experiment name within the project.

Example: checkout-experimentPattern: ^[a-zA-Z][-_a-zA-Z0-9]+$
descriptionstring · max: 250 · nullableOptional

Human-readable description of this experiment.

hypothesisstring · max: 500 · nullableOptional

Hypothesis this experiment is testing.

startAtstring · date-timeRequired

ISO-8601 timestamp when the experiment starts.

Example: 2025-06-01T12:00:00Z
endAtstring · date-timeRequired

ISO-8601 timestamp when the experiment ends.

Example: 2025-07-01T12:00:00Z
baselineTreatmentstringRequired

Treatment name. Must start with a letter or digit; remaining characters may be letters, digits, hyphens, underscores, or periods.

Example: onPattern: ^[a-zA-Z0-9][-_\.a-zA-Z0-9]*$
comparisonTreatmentsstring[] · min: 1Required

Comparison treatments (not including baselineTreatment).

Example: on
statusstring · enumRequired

Experiment lifecycle status. New experiments are ACTIVE. PATCH can set PAUSED, ARCHIVED, or COMPLETED. DELETE removes the experiment permanently rather than setting status: ARCHIVED (see the delete endpoint).

Possible values:
createdAtstring · date-timeRequired

ISO-8601 timestamp when the experiment was created.

Example: 2025-06-01T12:00:00Z
modifiedAtstring · date-timeRequired

ISO-8601 timestamp when the experiment was last modified.

Example: 2025-06-15T09:30:00Z
rulestring · nullableOptional

Targeting-rule label this experiment's results are scoped to (e.g. "default rule" or a specific targeting rule name on the parent flag). null when the experiment was created without one, in which case results use the experiment's default rule scope.

Example: default rule
get/v4/experiments/{experiment-id}
GET /fme/api/v4/experiments/{experiment-id}?account_id={{accountId}}&organization_identifier=default&project_identifier=my_project HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
  "type": "EXPERIMENT",
  "id": "01JAFXNTQHH8QTPTWYSG8H04Y5",
  "parent": {
    "type": "FEATURE_FLAG",
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "checkout-flag"
  },
  "name": "checkout-experiment",
  "description": null,
  "hypothesis": "Checkout conversion increases with treatment on.",
  "environment": {
    "id": "ad2eb8f0-9c3a-11ed-873c-e234abaad319",
    "name": "Production"
  },
  "trafficType": {
    "id": "a707c5af-94c1-4ca1-99dc-f0e72981c9ec",
    "name": "user"
  },
  "startAt": "2025-06-01T12:00:00Z",
  "endAt": "2025-07-01T12:00:00Z",
  "baselineTreatment": "off",
  "comparisonTreatments": [
    "on"
  ],
  "keyMetrics": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567892",
      "name": "conversion"
    }
  ],
  "supportingMetrics": [],
  "tags": [
    {
      "id": "checkout",
      "type": "TAG",
      "name": "checkout"
    }
  ],
  "owners": [
    {
      "type": "USER",
      "id": "xM5qi75eQYmdgJYfwNoHEQ"
    }
  ],
  "status": "ACTIVE",
  "createdAt": "2025-06-01T12:00:00Z",
  "modifiedAt": "2025-06-15T09:30:00Z"
}

Delete an Experiment

delete
/v4/experiments/{experiment-id}

Permanently deletes an Experiment. This is a hard delete — the experiment is removed, is not recoverable, and afterward a GET by id returns 404 and it no longer appears in LIST. It does not set status: ARCHIVED. The parent Feature Flag, AI Config, or Config is not deleted. CONFIG and warehouse-native experiments return 404 in v1.

Authorizations
x-api-keystringRequired

Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.

Path parameters
experiment-idstring · ulid · max: 128Required

The system-assigned identifier (ULID) of the experiment.

Example: 01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Query parameters
account_idstring · max: 128Required

Harness account identifier. Required on all endpoints.

Example: {{accountId}}Pattern: ^[-_A-Za-z0-9]+$
organization_identifierstring · max: 128Required

Harness organization identifier.

Example: defaultPattern: ^[-_A-Za-z0-9]+$
project_identifierstring · max: 128Required

Harness project identifier.

Example: my_projectPattern: ^[-_A-Za-z0-9]+$
Responses
200

OK — experiment deleted. Returns the governance result.

application/json

Response envelope for delete operations. Contains only the OPA governance result — no entity is returned. Shared by all FME resources so delete responses are consistent.

delete/v4/experiments/{experiment-id}
DELETE /fme/api/v4/experiments/{experiment-id}?account_id={{accountId}}&organization_identifier=default&project_identifier=my_project HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
  "governance": {
    "status": "NONE",
    "details": []
  }
}

Update an Experiment (partial)

patch
/v4/experiments/{experiment-id}

Partially updates an Experiment using JSON Merge Patch (RFC 7396, Content-Type: application/merge-patch+json). Fields omitted from the body are left unchanged. JSON null (or [] for arrays) clears description, hypothesis, keyMetrics, supportingMetrics, and tags. name, startAt, endAt, baselineTreatment, comparisonTreatments, and status cannot be cleared: omit the field to leave it unchanged; JSON null (or [] for comparisonTreatments) returns 400. Parent and environment cannot be changed. Renaming to a name already used in the project returns 409. CONFIG and warehouse-native experiments return 404 in v1.

Updatable fields: name, description, hypothesis, rule, startAt, endAt, baselineTreatment, comparisonTreatments, keyMetrics, supportingMetrics, tags, owners, status.

Authorizations
x-api-keystringRequired

Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.

Path parameters
experiment-idstring · ulid · max: 128Required

The system-assigned identifier (ULID) of the experiment.

Example: 01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
Query parameters
account_idstring · max: 128Required

Harness account identifier. Required on all endpoints.

Example: {{accountId}}Pattern: ^[-_A-Za-z0-9]+$
organization_identifierstring · max: 128Required

Harness organization identifier.

Example: defaultPattern: ^[-_A-Za-z0-9]+$
project_identifierstring · max: 128Required

Harness project identifier.

Example: my_projectPattern: ^[-_A-Za-z0-9]+$
Body

JSON Merge Patch body (RFC 7396) for updating an Experiment. All fields are optional. Omit a field to leave it unchanged. JSON null (or [] for arrays) clears description, hypothesis, rule, keyMetrics, supportingMetrics, tags, and owners. name, startAt, endAt, baselineTreatment, comparisonTreatments, and status cannot be cleared: omit to keep; JSON null (or [] for comparisonTreatments) returns 400. Parent and environment cannot be changed.

namestring · min: 2 · max: 250Optional

Updated name. null is not allowed.

Example: checkout-experimentPattern: ^[a-zA-Z][-_a-zA-Z0-9]+$
descriptionstring · max: 250 · nullableOptional

Updated description. null clears it.

hypothesisstring · max: 500 · nullableOptional

Updated hypothesis. null clears it.

rulestring · nullableOptional

Updated targeting-rule label. null clears it, reverting to the experiment's default rule scope.

Example: default rule
startAtstring · date-timeOptional

Updated start time. null is not allowed.

Example: 2025-06-02T12:00:00Z
endAtstring · date-timeOptional

Updated end time. null is not allowed.

Example: 2025-08-01T12:00:00Z
baselineTreatmentstringOptional

Treatment name. Must start with a letter or digit; remaining characters may be letters, digits, hyphens, underscores, or periods.

Example: onPattern: ^[a-zA-Z0-9][-_\.a-zA-Z0-9]*$
comparisonTreatmentsstring[] · min: 1Optional

Replacement comparison treatments (full replacement; not including baselineTreatment). At least one. null or [] returns 400.

Example: on
keyMetricsstring · uuid[] · nullableOptional

Replacement key metric ids. null or [] clears the list.

supportingMetricsstring · uuid[] · nullableOptional

Replacement supporting metric ids. null or [] clears the list.

statusstring · enumOptional

Experiment lifecycle status. New experiments are ACTIVE. PATCH can set PAUSED, ARCHIVED, or COMPLETED. DELETE removes the experiment permanently rather than setting status: ARCHIVED (see the delete endpoint).

Possible values:
Responses
200

OK — experiment updated.

application/json

Experiment mutation response envelope. Returned by create and update: the resulting entity together with the OPA governance result. Experiments are not a governed entity type, so governance is always present with status: NONE and empty details (no policy evaluation occurs); the envelope is kept for response-shape consistency with other v4 resources.

patch/v4/experiments/{experiment-id}
PATCH /fme/api/v4/experiments/{experiment-id}?account_id={{accountId}}&organization_identifier=default&project_identifier=my_project HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/merge-patch+json
Accept: */*
Content-Length: 82

{
  "name": "checkout-experiment-v2",
  "endAt": "2025-08-01T12:00:00Z",
  "status": "PAUSED"
}
{
  "entity": {
    "type": "EXPERIMENT",
    "id": "01JAFXNTQHH8QTPTWYSG8H04Y5",
    "parent": {
      "type": "FEATURE_FLAG",
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "checkout-flag"
    },
    "name": "checkout-experiment",
    "description": null,
    "hypothesis": "Checkout conversion increases with treatment on.",
    "environment": {
      "id": "ad2eb8f0-9c3a-11ed-873c-e234abaad319",
      "name": "Production"
    },
    "trafficType": {
      "id": "a707c5af-94c1-4ca1-99dc-f0e72981c9ec",
      "name": "user"
    },
    "startAt": "2025-06-01T12:00:00Z",
    "endAt": "2025-07-01T12:00:00Z",
    "baselineTreatment": "off",
    "comparisonTreatments": [
      "on"
    ],
    "keyMetrics": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567892",
        "name": "conversion"
      }
    ],
    "supportingMetrics": [],
    "tags": [
      {
        "id": "checkout",
        "type": "TAG",
        "name": "checkout"
      }
    ],
    "owners": [
      {
        "type": "USER",
        "id": "xM5qi75eQYmdgJYfwNoHEQ"
      }
    ],
    "status": "ACTIVE",
    "createdAt": "2025-06-01T12:00:00Z",
    "modifiedAt": "2025-06-15T09:30:00Z",
    "rule": "default rule"
  },
  "governance": {
    "status": "PASS",
    "details": []
  }
}

Last updated

Was this helpful?