import_experiment

Add a concluded experiment. Embeds the title and hypothesis, stores the experiment, and starts a learning extraction job. Do not send processed_results; Garasu computes them from raw_results.

Operation ID: import_experiment

Add a concluded experiment. Embeds the title and hypothesis, stores the experiment, and starts a learning extraction job. Do not send processed_results; Garasu computes them from raw_results.

When to use: You have a concluded test with results and want it stored on a project. Skip drafts and tests that are still running.

Returns: { experiment_id, experiment }

FieldTypeRequiredDescription
project_iduuidYesProject id from list_projects.
experimentobjectYesThe concluded experiment to store. Garasu computes processed_results.

experiment fields:

FieldTypeRequiredDescription
namestringNoDisplay title. Max 200 characters. When omitted, Garasu uses the first 200 characters of the hypothesis.
hypothesisstringYesWhat was tested and why. 1–8000 characters.
start_datestringYesWhen the test started, as ISO 8601.
end_datestringYesWhen the test ended, as ISO 8601. Must be on or after start_date.
variant_keysstring[]YesEvery arm, including the control. At least two unique keys.
control_variant_keystringYesThe control arm. Must be one of variant_keys.
raw_resultsobject[]YesOne row per metric per variant. At least two. Each row needs metric, variant_key, users, and conversions or mean.
metadataobjectNoSource details, such as source and source_id. Defaults to {}.
conclusionstringNoOutcome label, such as won, lost, or inconclusive. Max 40 characters.
conclusion_summarystringNoShort write-up of the outcome. Max 8000 characters.
winning_variantstringNoWinning arm, when the source named one. Max 80 characters.

experiment.raw_results[] fields:

FieldTypeRequiredDescription
metricstringYesMetric name. Max 120 characters.
variant_keystringYesArm this row belongs to. Must be one of variant_keys.
usersintegerYesSample size. Must be greater than 0.
conversionsintegerNoConversion count for a rate metric. Cannot exceed users.
meannumberNoObserved mean for a continuous metric. Required when conversions is omitted.
variancenumberNoSample variance of the per-user metric. Preferred for mean metrics.
sum_squaresnumberNoSum of squares of the per-user metric. Used when variance is omitted.

Function schema:

{
  "name": "import_experiment",
  "description": "Add a concluded experiment. Embeds the title and hypothesis, stores the experiment, and starts a learning extraction job. Do not send processed_results; Garasu computes them from raw_results. You have a concluded test with results and want it stored on a project. Skip drafts and tests that are still running.",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "project_id": {
        "type": "string",
        "format": "uuid",
        "description": "Project id from list_projects."
      },
      "experiment": {
        "type": "object",
        "description": "The concluded experiment to store. Garasu computes processed_results.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Display title. Max 200 characters. When omitted, Garasu uses the first 200 characters of the hypothesis."
          },
          "hypothesis": {
            "type": "string",
            "description": "What was tested and why. 1–8000 characters."
          },
          "start_date": {
            "type": "string",
            "description": "When the test started, as ISO 8601."
          },
          "end_date": {
            "type": "string",
            "description": "When the test ended, as ISO 8601. Must be on or after start_date."
          },
          "variant_keys": {
            "type": "array",
            "description": "Every arm, including the control. At least two unique keys.",
            "items": {
              "type": "string"
            }
          },
          "control_variant_key": {
            "type": "string",
            "description": "The control arm. Must be one of variant_keys."
          },
          "raw_results": {
            "type": "array",
            "description": "One row per metric per variant. At least two. Each row needs metric, variant_key, users, and conversions or mean.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "metric": {
                  "type": "string",
                  "description": "Metric name. Max 120 characters."
                },
                "variant_key": {
                  "type": "string",
                  "description": "Arm this row belongs to. Must be one of variant_keys."
                },
                "users": {
                  "type": "integer",
                  "description": "Sample size. Must be greater than 0."
                },
                "conversions": {
                  "type": "integer",
                  "description": "Conversion count for a rate metric. Cannot exceed users."
                },
                "mean": {
                  "type": "number",
                  "description": "Observed mean for a continuous metric. Required when conversions is omitted."
                },
                "variance": {
                  "type": "number",
                  "description": "Sample variance of the per-user metric. Preferred for mean metrics."
                },
                "sum_squares": {
                  "type": "number",
                  "description": "Sum of squares of the per-user metric. Used when variance is omitted."
                }
              },
              "required": [
                "metric",
                "variant_key",
                "users"
              ]
            }
          },
          "metadata": {
            "type": "object",
            "description": "Source details, such as source and source_id. Defaults to {}.",
            "additionalProperties": true,
            "properties": {}
          },
          "conclusion": {
            "type": "string",
            "description": "Outcome label, such as won, lost, or inconclusive. Max 40 characters."
          },
          "conclusion_summary": {
            "type": "string",
            "description": "Short write-up of the outcome. Max 8000 characters."
          },
          "winning_variant": {
            "type": "string",
            "description": "Winning arm, when the source named one. Max 80 characters."
          }
        },
        "required": [
          "hypothesis",
          "start_date",
          "end_date",
          "variant_keys",
          "control_variant_key",
          "raw_results"
        ]
      }
    },
    "required": [
      "project_id",
      "experiment"
    ]
  }
}

Request:

{
  "project_id": "11111111-1111-4111-8111-111111111111",
  "experiment": {
    "name": "Cart shipping estimate",
    "hypothesis": "If we show an estimated shipping range on cart, checkout completion will go up because people stop getting surprised by cost at payment.",
    "start_date": "2026-03-01T00:00:00.000Z",
    "end_date": "2026-03-28T00:00:00.000Z",
    "variant_keys": [
      "control",
      "estimate"
    ],
    "control_variant_key": "control",
    "raw_results": [
      {
        "metric": "Checkout completion",
        "variant_key": "control",
        "users": 24105,
        "conversions": 822
      },
      {
        "metric": "Checkout completion",
        "variant_key": "estimate",
        "users": 24105,
        "conversions": 882
      }
    ],
    "metadata": {
      "source": "posthog",
      "source_id": "cart-shipping-estimate"
    }
  }
}

Response:

{
  "experiment_id": "22222222-2222-4222-8222-222222222222",
  "experiment": {
    "id": "22222222-2222-4222-8222-222222222222",
    "project_id": "11111111-1111-4111-8111-111111111111",
    "name": "Cart shipping estimate",
    "hypothesis": "If we show an estimated shipping range on cart, checkout completion will go up because people stop getting surprised by cost at payment.",
    "start_date": "2026-03-01",
    "end_date": "2026-03-28",
    "variant_keys": [
      "control",
      "estimate"
    ],
    "control_variant_key": "control",
    "metadata": {
      "source": "posthog",
      "source_id": "cart-shipping-estimate"
    },
    "headline": {
      "metric": "Checkout completion",
      "variant_key": "estimate",
      "lift_relative": 7.2993,
      "p_value": 0.1389,
      "control_n": 24105,
      "variant_n": 24105
    },
    "processed_results": [
      {
        "metric": "Checkout completion",
        "variant_key": "estimate",
        "control_variant_key": "control",
        "control_n": 24105,
        "variant_n": 24105,
        "control_mean": 0.034101,
        "variant_mean": 0.03659,
        "lift_absolute": 0.002489,
        "lift_relative": 7.2993,
        "p_value": 0.1389,
        "z_score": 1.4799,
        "post_hoc_power": 32,
        "mde80_relative": 13.8182,
        "kind": "rate",
        "control_variance": 0.032939,
        "variant_variance": 0.035251
      }
    ],
    "related_learning_ids": [],
    "related_learnings": [],
    "source_url": "https://garasu.co/app/77777777-7777-4777-8777-777777777777/projects/11111111-1111-4111-8111-111111111111/experiments/22222222-2222-4222-8222-222222222222",
    "created_at": "2026-03-29T14:12:00.000Z",
    "updated_at": "2026-03-29T14:12:00.000Z",
    "raw_results": [
      {
        "metric": "Checkout completion",
        "variant_key": "control",
        "users": 24105,
        "conversions": 822
      },
      {
        "metric": "Checkout completion",
        "variant_key": "estimate",
        "users": 24105,
        "conversions": 882
      }
    ]
  }
}