Create traffic allocation
Creates a new traffic allocation for an assistant, replacing the one currently in effect. To start or adjust a split, send targets naming published versions (such as “v7”) with percentages totaling 100; allocationIntent is inferred as ‘explicit’. To stop splitting and send every call to the newest published version, send allocationIntent ‘follow-latest’ with no targets field; stopping always names its intent, so a dropped targets field can never end a split by accident. Traffic splitting is in beta, rolling out to select organizations; requests from organizations without access receive a 403.
Authentication
Authenticate server-side requests with a private Vapi API key. Create or copy a key from the Vapi Dashboard and send it in the Authorization header as Bearer <token>. Keep private API keys out of client-side code and public repositories.
Request
‘explicit’ splits calls across targets, and is inferred when targets is sent. ‘follow-latest’ sends every call to the newest published version and is how you stop splitting; it must be sent explicitly.
The versions to split calls across. Omit to stop splitting (with allocationIntent ‘follow-latest’). Order in this array is the selection order (position).
Optional concurrency guard. Omit it and the write applies unconditionally (last write wins, matching every other Vapi update surface). Provide the id of the allocation you last read and the write applies only while that allocation is still governing; any mismatch is a 409 carrying the actual current id.
Response
‘explicit’ splits calls across this allocation’s targets. ‘follow-latest’ sends every call to the newest published version.
Who created this allocation. ‘system’ means Vapi created it automatically, for example when a publish advances a follow-latest allocation.
The versions this allocation splits calls across, in position order. Empty for follow-latest allocations.