Start an A/B experiment
POSThttps://platform.docana.com/api/v1/agents/:agentId/experiments/
Starts a live A/B experiment comparing the agent’s published spec (control) against a CANDIDATE branch (variant), routing trafficPercent of this agent’s conversations to the variant. Both arms are pinned to the exact (artifactId, version) they hold right now, so neither editing the branch nor publishing the agent moves what is being compared. Assignment is per thread and sticky: a conversation never changes arms mid-way. One running experiment per agent; publishing the agent ends the running one. Optionally names the Insights data point that decides the winner, guardrails that end the experiment when the variant breaches them, a minimum duration before a recommendation, a horizon, and the idle window that closes a thread on channels that never archive.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 500
The experiment was started
Invalid request body, or the named branch is not a live CANDIDATE
The API key or session is missing, expired, or malformed.
The caller is authenticated but not allowed to perform this operation.
Agent not found, no access to the application, agent experiments not enabled there, or branch (or its spec artifact) not found
This agent already has a running experiment, or it has no published version to use as control
Unexpected server error.