Create experiments
POST /api/v1/laboratory/experiments: request fields and declared response contract.
POST/api/v1/laboratory/experiments
| Permission | laboratory.method.publish |
|---|---|
| Workspace scope | required |
| Scope target | workspace |
Request body
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| experimentRef | string | required | non-null | — |
| title | string | required | non-null | — |
| objectiveVersionRef | string | required | non-null | — |
| subjects | array | required | non-null | — |
| caseSetRef | string | required | non-null | — |
| method | object | required | non-null | — |
| method.methodKind | "replay" | "simulation" | "optimization" | "backtest" | "rollout" | required | non-null | — |
| method.methodRef | string | required | non-null | — |
| method.releaseRef | string | optional | non-null | — |
| method.configDigest | string | required | non-null | — |
| inputs | array | optional | non-null | — |
| evaluation | object | required | non-null | — |
| evaluation.mode | "prospective" | "retrospective" | "actual_vs_predicted" | required | non-null | — |
| evaluation.bundleRef | string | required | non-null | — |
| evaluation.baselineRef | string | optional | non-null | — |
Response
201
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| data | object | required | non-null | — |
| data.experimentRef | string | required | non-null | — |
| data.revision | integer | required | non-null | — |
| data.title | string | required | non-null | — |
| data.objectiveVersionRef | string | required | non-null | — |
| data.subjects | array | required | non-null | — |
| data.caseSetRef | string | required | non-null | — |
| data.method | object | required | non-null | — |
| data.method.methodKind | "replay" | "simulation" | "optimization" | "backtest" | "rollout" | required | non-null | — |
| data.method.methodRef | string | required | non-null | — |
| data.method.releaseRef | string | optional | non-null | — |
| data.method.configDigest | string | required | non-null | — |
| data.inputs | array | required | non-null | [] |
| data.evaluation | object | required | non-null | — |
| data.evaluation.mode | "prospective" | "retrospective" | "actual_vs_predicted" | required | non-null | — |
| data.evaluation.bundleRef | string | required | non-null | — |
| data.evaluation.baselineRef | string | optional | non-null | — |
| data.policyEvidence | object | required | non-null | — |
| data.policyEvidence.policyRefs | array | required | non-null | [] |
| data.policyEvidence.approvalState | "not_required" | "pending" | "approved" | "rejected" | required | non-null | — |
| data.policyEvidence.evaluatedAt | string | optional | non-null | — |
| data.createdBy | string | required | non-null | — |
| data.createdAt | string | required | non-null | — |
| data.compositionDigest | string | required | non-null | — |
Declared failures
| ACCESS_DENIED | 403 — not retryable |
|---|---|
| APPROVAL_REQUIRED | 403 — not retryable |
| CORE_ERROR | 500 — not retryable |
| GOVERNANCE_DENIED | 403 — not retryable |
| NOT_FOUND | 404 — not retryable |
| QUOTA_DENIED | 429 — retryable |
| REBASE_CONFLICT | 409 — not retryable |
| REVISION_CONFLICT | 409 — retryable |
| SETUP_REQUIRED | 503 — not retryable |
| VALIDATION_ERROR | 400 — not retryable |
| VALIDATION_INPUT_ERROR | 400 — not retryable |
Readback
Read the result back with:
- laboratory.experiments.read
Request example
Schematic only. Replace placeholders with real values and include all required nested fields.
POST /api/v1/laboratory/experiments HTTP/1.1
Authorization: Bearer <token>
x-merulan-workspace-id: <workspace-id>
Content-Type: application/json
{
"experimentRef": "<experimentRef>",
"title": "<title>",
"objectiveVersionRef": "<objectiveVersionRef>",
"subjects": [],
"caseSetRef": "<caseSetRef>",
"method": {},
"evaluation": {}
}