Skip to main content
POST
/
experiments
Create an experiment
curl --request POST \
  --url https://api.qonversion.io/v4/experiments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "alias_id": "<string>",
  "description": "<string>",
  "segment_percent": 123,
  "primary_metric": "<string>",
  "goal_value": 123,
  "goal_direction": "<string>",
  "context_key": "<string>",
  "is_context_specific": true
}
'
{
  "object": "experiment",
  "id": "<string>",
  "url": "<string>",
  "name": "<string>",
  "description": "<string>",
  "status": "<string>",
  "started_at": "2023-11-07T05:31:56Z",
  "finished_at": "2023-11-07T05:31:56Z",
  "segment_percent": 123,
  "primary_metric": "<string>",
  "goal_value": 123,
  "goal_direction": "<string>",
  "context_key": "<string>",
  "is_context_specific": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication using the project Secret Key (prefixed with sk_, or test_sk_ for sandbox). All v4 public endpoints require the Secret Key — see Authentication. Never expose the Secret Key in client-side code.

Body

application/json
name
string
required

Experiment display name.

alias_id
string
required

Stable identifier for the experiment. Alphanumeric, hyphens, underscores, dots. Max 256 characters.

Maximum string length: 256
Pattern: ^[a-zA-Z0-9._-]+$
description
string

Optional experiment description.

segment_percent
number | null

Percentage of users to include in the experiment.

primary_metric
string | null

Primary success metric.

goal_value
number | null

Target value for the primary metric.

goal_direction
string | null

Desired direction of change.

context_key
string

Context key for context-specific experiments.

is_context_specific
boolean

Whether this experiment is restricted to a specific context.

Response

Experiment created.

object
string
Example:

"experiment"

id
string

Experiment identifier.

url
string

Canonical API path.

name
string

Experiment display name.

description
string

Experiment description.

status
string

Current experiment status.

started_at
string<date-time> | null

ISO 8601 timestamp when the experiment was started.

finished_at
string<date-time> | null

ISO 8601 timestamp when the experiment was finished.

segment_percent
number | null

Percentage of users included in the experiment.

primary_metric
string | null

Primary success metric.

goal_value
number | null

Target value for the primary metric.

goal_direction
string | null

Desired direction of change for the primary metric.

context_key
string

Context key for context-specific experiments.

is_context_specific
boolean

Whether this experiment is restricted to a specific context.

created_at
string<date-time>

ISO 8601 creation timestamp.

updated_at
string<date-time>

ISO 8601 last update timestamp.