Manage Traffic
Manage challenger models and traffic allocation for a deployment. This endpoint supports adding challengers for A/B testing, removing challengers, updating traffic percentages, and toggling shadow mode for silent scoring comparison.
owner or admin.Path Parameters
The deployment slug (e.g. dep_xK8m).
Body Parameters
The traffic management action to perform. One of:
add_challenger— Add a model as a challenger to receive a percentage of trafficremove_challenger— Remove a challenger and redirect its traffic to the championupdate_traffic— Change the traffic percentage for an existing challengertoggle_shadow— Enable or disable shadow mode
Required for add_challenger. The model ID to add as a challenger.
Required for remove_challenger and update_traffic. The challenger entry ID.
Required for add_challenger and update_traffic. Percentage of traffic (1-50) to route to the challenger.
Required for toggle_shadow. When true, challengers score requests silently without affecting the response.
Error Responses
JWT is missing or expired.
No deployment exists with the provided slug.
Total challenger traffic would exceed 50%, or required parameters are missing for the action.
curl -X PATCH https://api.cali-br.com/v1/deployments/dep_xK8m/traffic \
-H #a5d6ff">"Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
-H #a5d6ff">"Content-Type: application/json" \
-d '{
#a5d6ff">"action": "add_challenger",
#a5d6ff">"model_id": "mod_nY5kT2Wq",
#a5d6ff">"traffic_pct": 10
}'{
"deployment_id": "dep_xK8m",
"action": "add_challenger",
"challenger": {
"id": "ch_abc123",
"model_id": "mod_nY5kT2Wq",
"traffic_pct": 10,
"is_active": true
},
"cache_version": 4
}