Traffic Allocations

Create traffic allocation

Changed on

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.

post/traffic-allocations

Request

  • Base URL
    https://api.vapi.ai
  • Auth
    HTTP bearer

Request body

assistantIdstring required

The assistant whose calls this allocation splits.

allocationIntent'follow-latest' | 'explicit'

'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.

expectedCurrentAllocationIdstring uuid

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.

descriptionstring

An optional note explaining why you made this change.

Response

idstring required

Unique identifier. The most recently created allocation for an assistant is the one in effect.

orgIdstring required
assistantIdstring

The assistant this allocation splits calls for.

allocationIntent'follow-latest' | 'explicit' required

'explicit' splits calls across this allocation's targets. 'follow-latest' sends every call to the newest published version.

createdAtstring date-time required

When this allocation was created, which is also when it took effect.

actorType'user' | 'api-key' | 'system' required

Who created this allocation. 'system' means Vapi created it automatically, for example when a publish advances a follow-latest allocation.

actorIdstring

The user id or API key id that created this allocation. Absent for system rows.

actorEmailstring

Email of the user who created this allocation, as of that time.

descriptionstring

The note given when this allocation was created, if any.

Changes

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added response discriminator for the response status

    • info

      endpoint added

Some revisions have not been checked yet.