Compute experiment
Run the weighted-synthetic-control diff-in-diff inference for this experiment against the location's BigQuery dataset, store the metrics on the experiment's result, and set status to computed. Requires an agency (ak_) key.
Compute is gated on the measured window (test window + cooldown): before it closes the endpoint returns 409 window_not_complete. Pass { "allow_partial": true } for a provisional mid-window read — it is stamped result.partial: true and excluded from /coefficients until a full compute overwrites it.
Compute also refuses to produce silently-wrong numbers: no revenue in the test or control regions (422 no_revenue_in_regions / no_revenue_in_controls), a truncated BigQuery page (422 result_truncated), a missing Meta insights table (422 spend_table_missing), mixed account currencies (422 mixed_currencies — set spend.account_id), or Meta spend data that ends well before the measured window (409 stale_spend_data — wait for the next Airbyte sync).
curl -X POST "https://mythic-analytics.gulp.workers.dev/client/v1/incrementality/experiments/123e4567-e89b-12d3-a456-426614174000/compute" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"allow_partial": true
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/incrementality/experiments/123e4567-e89b-12d3-a456-426614174000/compute"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"allow_partial": true
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/incrementality/experiments/123e4567-e89b-12d3-a456-426614174000/compute", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"allow_partial": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"allow_partial": true
}`)
req, err := http.NewRequest("POST", "https://mythic-analytics.gulp.workers.dev/client/v1/incrementality/experiments/123e4567-e89b-12d3-a456-426614174000/compute", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/incrementality/experiments/123e4567-e89b-12d3-a456-426614174000/compute')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"allow_partial": true
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"location_id": "example_string",
"name": "John Doe",
"channel": "meta",
"status": "draft",
"definition": {
"test_regions": [
"California",
"Texas"
],
"control_regions": [
"Ohio",
"Georgia"
],
"pre_window": {
"from": "2026-05-01",
"to": "2026-05-31"
},
"test_window": {
"from": "2026-05-01",
"to": "2026-05-31"
},
"revenue": {
"source": "event",
"measure": "revenue",
"event_name": "purchase",
"json_path": "$.value",
"timezone": "America/New_York",
"table": "transactions",
"column": "amount",
"region_col": "state",
"date_col": "created_date"
},
"spend": {
"source": "geo_stream",
"region_col": "region",
"table": "example_string",
"campaign_ids": [
"example_string"
],
"name_pattern": "John Doe",
"account_id": "example_string",
"purchase_action_type": "lead"
},
"geo_inherit": true,
"daily_budget": 500,
"mde_iroas": 3.14,
"design_lookback_days": 42,
"cooldown_days": 42,
"exclude_dates": [
"2024-12-25"
],
"alert_webhook_url": "example_string"
},
"design": {
"ok": true,
"reason": "example_string",
"recommended_days": 28,
"raw_days": 42,
"sigma_daily": 3.14,
"scaling_k": 3.14,
"baseline_days": 42,
"baseline_window": {
"from": "2026-05-01",
"to": "2026-05-31"
},
"assumptions": {
"daily_budget": 3.14,
"mde_iroas": 3.14,
"alpha": 3.14,
"power": 3.14
}
},
"progress": {
"phase": "pending",
"days_total": 42,
"test_days": 42,
"cooldown_days": 42,
"days_elapsed": 42,
"days_remaining": 42,
"percent": 42,
"recommended_days": 42,
"underpowered": true
},
"result": {
"incremental_revenue": 3.14,
"test_spend": 3.14,
"platform_revenue": 3.14,
"iroas": 3.14,
"platform_roas": 3.14,
"coefficient": 1.15,
"ci_width": 3.14,
"se_lift": 3.14,
"sigma_daily": 3.14,
"se_iroas": 3.14,
"se_coefficient": 3.14,
"z_score": 3.14,
"confidence": 0.97,
"p_value": 3.14,
"significant": true,
"two_sided_significant": true,
"iroas_ci": [
3.14
],
"coefficient_ci": [
3.14
],
"partial": true,
"series_key": "example_string",
"spend_currency": "example_string",
"spend_data_through": "2024-12-25",
"pre_days": 42,
"post_days": 42,
"control_weights": {},
"fit_r2": 3.14,
"outlier_days": [
"2024-12-25"
],
"excluded_dates": [
"2024-12-25"
],
"control_shift_z": 3.14,
"warnings": [
"example_string"
],
"test_pre": 3.14,
"test_post": 3.14,
"control_pre": 3.14,
"control_post": 3.14,
"computed_at": "2024-12-25T10:00:00Z"
},
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Conflict",
"message": "The request conflicts with the current state of the resource",
"code": 409,
"details": "Resource already exists"
}
{
"error": "Unprocessable Entity",
"message": "The request was well-formed but contains semantic errors",
"code": 422,
"details": [
{
"field": "password",
"message": "Password must be at least 8 characters long"
}
]
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
{
"error": "Error",
"message": "Compute query failed or the result could not be saved",
"code": 502
}
/client/v1/incrementality/experiments/{id}/computeTarget server for requests. Edit to use your own host.
Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need incrementality:read or incrementality:write. See Using an mcp_ key over HTTP.
Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need incrementality:read or incrementality:write. See Using an mcp_ key over HTTP.
Experiment identifier.
The media type of the request body
Compute before the measured window closes (provisional; excluded from /coefficients).
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need incrementality:read or incrementality:write. See Using an mcp_ key over HTTP.
Path Parameters
Experiment identifier.
Body
Compute before the measured window closes (provisional; excluded from /coefficients).