Experiments
Manage workspace-scoped 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.
Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.
Harness account identifier. Required on all endpoints.
{{accountId}}Pattern: ^[-_A-Za-z0-9]+$Harness organization identifier.
defaultPattern: ^[-_A-Za-z0-9]+$Harness project identifier.
my_projectPattern: ^[-_A-Za-z0-9]+$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.
FEATURE_FLAGPossible values: Filter to experiments assigned in this environment.
ad2eb8f0-9c3a-11ed-873c-e234abaad319Pattern: ^[-_A-Za-z0-9]+$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.
checkout-flagPattern: ^[A-Za-z][-_A-Za-z0-9]*$Filter by experiment name. Used with match_type.
checkout-experimentHow name is matched. Ignored when name is omitted.
containsExample: containsPossible values: Filter to experiments that have any of the specified tags (by tag name).
Number of items to return per page. Defaults to 100, maximum 100.
100Example: 100Number of items to skip before the first returned result. Defaults to 0.
0Example: 0OK — paginated list of experiments returned.
Paginated list of Experiments matching the query.
The page size used for this response.
100The number of items skipped before the first result.
0Total number of experiments matching the query.
42Bad Request — validation errors or invalid state transition.
Unauthorized — the request is missing a valid API key, or the key has expired.
Forbidden — the caller is authenticated but not permitted to perform this operation.
Returned when the API can deny the operation without leaking whether a resource exists,
such as create, or write operations where the caller can already read the resource. When
returning 403 would reveal resource existence, the API returns 404 instead.
Environment-scoped mutations that require approval also return 403.
Not Found — the requested resource does not exist. Also returned when the caller lacks access to the resource (to avoid leaking resource existence).
Too Many Requests — the caller has exceeded the rate limit for this endpoint.
Internal Server Error — an unexpected error occurred while processing the request.
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
}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.
Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.
Harness account identifier. Required on all endpoints.
{{accountId}}Pattern: ^[-_A-Za-z0-9]+$Harness organization identifier.
defaultPattern: ^[-_A-Za-z0-9]+$Harness project identifier.
my_projectPattern: ^[-_A-Za-z0-9]+$Environment the experiment is assigned in.
ad2eb8f0-9c3a-11ed-873c-e234abaad319Pattern: ^[-_A-Za-z0-9]+$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).
Unique experiment name within the project.
checkout-experimentPattern: ^[a-zA-Z][-_a-zA-Z0-9]+$Human-readable description of this experiment.
Hypothesis this experiment is testing.
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.
default ruleISO-8601 timestamp when the experiment starts.
2025-06-01T12:00:00ZISO-8601 timestamp when the experiment ends.
2025-07-01T12:00:00ZTreatment name. Must start with a letter or digit; remaining characters may be letters, digits, hyphens, underscores, or periods.
onPattern: ^[a-zA-Z0-9][-_\.a-zA-Z0-9]*$Comparison treatments (not including baselineTreatment).
onMetric ids to set as key metrics. Omit for none.
["a1b2c3d4-e5f6-7890-abcd-ef1234567892"]Metric ids to set as supporting metrics. Omit for none.
Created — the experiment was successfully created.
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.
Bad Request — validation errors or invalid state transition.
Unauthorized — the request is missing a valid API key, or the key has expired.
Forbidden — the caller is authenticated but not permitted to perform this operation.
Returned when the API can deny the operation without leaking whether a resource exists,
such as create, or write operations where the caller can already read the resource. When
returning 403 would reveal resource existence, the API returns 404 instead.
Environment-scoped mutations that require approval also return 403.
Not Found — the requested resource does not exist. Also returned when the caller lacks access to the resource (to avoid leaking resource existence).
Conflict — a resource with this identifier already exists, the operation conflicts with an
open change request, or the resource cannot be deleted/archived while dependents still
exist. Discriminate with errorType: resourceAlreadyExists, pendingChangeConflict, or
hasDependents. For hasDependents, detail is the archiver message when one is
available; otherwise Resource has active dependents.
Too Many Requests — the caller has exceeded the rate limit for this endpoint.
Internal Server Error — an unexpected error occurred while processing the request.
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": []
}
}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.
Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.
The system-assigned identifier (ULID) of the experiment.
01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$Harness account identifier. Required on all endpoints.
{{accountId}}Pattern: ^[-_A-Za-z0-9]+$Harness organization identifier.
defaultPattern: ^[-_A-Za-z0-9]+$Harness project identifier.
my_projectPattern: ^[-_A-Za-z0-9]+$OK — experiment returned.
A workspace-scoped Experiment.
Resource type discriminator. Always EXPERIMENT.
Unique system-assigned identifier for the experiment. Use this as the path parameter in subsequent requests.
01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$Unique experiment name within the project.
checkout-experimentPattern: ^[a-zA-Z][-_a-zA-Z0-9]+$Human-readable description of this experiment.
Hypothesis this experiment is testing.
ISO-8601 timestamp when the experiment starts.
2025-06-01T12:00:00ZISO-8601 timestamp when the experiment ends.
2025-07-01T12:00:00ZTreatment name. Must start with a letter or digit; remaining characters may be letters, digits, hyphens, underscores, or periods.
onPattern: ^[a-zA-Z0-9][-_\.a-zA-Z0-9]*$Comparison treatments (not including baselineTreatment).
onExperiment 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).
ISO-8601 timestamp when the experiment was created.
2025-06-01T12:00:00ZISO-8601 timestamp when the experiment was last modified.
2025-06-15T09:30:00ZTargeting-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.
default ruleBad Request — validation errors or invalid state transition.
Unauthorized — the request is missing a valid API key, or the key has expired.
Not Found — the requested resource does not exist. Also returned when the caller lacks access to the resource (to avoid leaking resource existence).
Too Many Requests — the caller has exceeded the rate limit for this endpoint.
Internal Server Error — an unexpected error occurred while processing the request.
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"
}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.
Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.
The system-assigned identifier (ULID) of the experiment.
01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$Harness account identifier. Required on all endpoints.
{{accountId}}Pattern: ^[-_A-Za-z0-9]+$Harness organization identifier.
defaultPattern: ^[-_A-Za-z0-9]+$Harness project identifier.
my_projectPattern: ^[-_A-Za-z0-9]+$OK — experiment deleted. Returns the governance result.
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.
Bad Request — validation errors or invalid state transition.
Unauthorized — the request is missing a valid API key, or the key has expired.
Forbidden — the caller is authenticated but not permitted to perform this operation.
Returned when the API can deny the operation without leaking whether a resource exists,
such as create, or write operations where the caller can already read the resource. When
returning 403 would reveal resource existence, the API returns 404 instead.
Environment-scoped mutations that require approval also return 403.
Not Found — the requested resource does not exist. Also returned when the caller lacks access to the resource (to avoid leaking resource existence).
Too Many Requests — the caller has exceeded the rate limit for this endpoint.
Internal Server Error — an unexpected error occurred while processing the request.
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": []
}
}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.
Harness Service Account Token (SAT) or Personal Access Token (PAT). Generate tokens in Harness under Account Settings → Access Management.
The system-assigned identifier (ULID) of the experiment.
01JAFXNTQHH8QTPTWYSG8H04Y5Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$Harness account identifier. Required on all endpoints.
{{accountId}}Pattern: ^[-_A-Za-z0-9]+$Harness organization identifier.
defaultPattern: ^[-_A-Za-z0-9]+$Harness project identifier.
my_projectPattern: ^[-_A-Za-z0-9]+$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.
Updated name. null is not allowed.
checkout-experimentPattern: ^[a-zA-Z][-_a-zA-Z0-9]+$Updated description. null clears it.
Updated hypothesis. null clears it.
Updated targeting-rule label. null clears it, reverting to the experiment's default
rule scope.
default ruleUpdated start time. null is not allowed.
2025-06-02T12:00:00ZUpdated end time. null is not allowed.
2025-08-01T12:00:00ZTreatment name. Must start with a letter or digit; remaining characters may be letters, digits, hyphens, underscores, or periods.
onPattern: ^[a-zA-Z0-9][-_\.a-zA-Z0-9]*$Replacement comparison treatments (full replacement; not including baselineTreatment).
At least one. null or [] returns 400.
onReplacement key metric ids. null or [] clears the list.
Replacement supporting metric ids. null or [] clears the list.
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).
OK — experiment updated.
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.
Bad Request — validation errors or invalid state transition.
Unauthorized — the request is missing a valid API key, or the key has expired.
Forbidden — the caller is authenticated but not permitted to perform this operation.
Returned when the API can deny the operation without leaking whether a resource exists,
such as create, or write operations where the caller can already read the resource. When
returning 403 would reveal resource existence, the API returns 404 instead.
Environment-scoped mutations that require approval also return 403.
Not Found — the requested resource does not exist. Also returned when the caller lacks access to the resource (to avoid leaking resource existence).
Conflict — a resource with this identifier already exists, the operation conflicts with an
open change request, or the resource cannot be deleted/archived while dependents still
exist. Discriminate with errorType: resourceAlreadyExists, pendingChangeConflict, or
hasDependents. For hasDependents, detail is the archiver message when one is
available; otherwise Resource has active dependents.
Too Many Requests — the caller has exceeded the rate limit for this endpoint.
Internal Server Error — an unexpected error occurred while processing the request.
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?