Skip to main content

Create simulation

POST /simulations

Sample next-item sequences for a supplied population. Requires simulate capability. Person IDs must be unique within the request; candidate IDs must belong to the model catalog. Steps are interactions, not time. The same seed is reproducible within a pinned model and runtime.

Use the variables supplied at onboarding.

curl --fail-with-body -X POST "$JEAN_BASE_URL/simulations" \
-H "Authorization: Bearer $JEAN_API_KEY" \
-H "Idempotency-Key: YOUR_UNIQUE_REQUEST_KEY" \
-H "Content-Type: application/json" \
-d '{"model_id":"mdl_sim_demo_v1","population":[{"person_id":"person_7","history":["sku_42"]}],"candidate_item_ids":["sku_43","sku_44"],"steps":5,"trajectories_per_person":1,"repeat_policy":"allow","seed":42}'

Body

FieldTypeRequiredNotes
model_idstringyes
populationobject[]yes1–20 entries.
candidate_item_idsstring[]yes1–1000 entries.
stepsintegernoDefault: 5. Range: 1–10.
trajectories_per_personintegernoDefault: 1. Range: 1–5.
repeat_policyallow, exclude_historynoDefault: "allow".
seedintegeryesRange: 0–2147483647.

Response · 202

{
"id": "job_demo",
"kind": "simulation",
"status": "queued",
"request_id": "req_demo"
}

Poll Get job with the returned id. Errors and retries · Complete schemas