Bulk User Update
Bulk update multiple users at once.
This endpoint allows updating multiple users in a single request. Each user update is processed independently - if some updates fail, others will still succeed.
Parameters:
- users: Optional[List[UpdateUserRequest]] - List of specific user update requests
- all_users: Optional[bool] - Set to true to update all users in the system
- user_updates: Optional[UpdateUserRequest] - Updates to apply when all_users=True
Returns:
- results: List of individual update results
- total_requested: Total number of users requested for update
- successful_updates: Number of successful updates
- failed_updates: Number of failed updates
Example request for specific users:
curl --location 'http://0.0.0.0:4000/user/bulk_update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"users": [
{
"user_id": "user1",
"user_role": "internal_user",
"max_budget": 100.0
},
{
"user_email": "user2@example.com",
"user_role": "internal_user_viewer",
"max_budget": 50.0
}
]
}'
Example request for all users:
curl --location 'http://0.0.0.0:4000/user/bulk_update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"all_users": true,
"user_updates": {
"user_role": "internal_user",
"max_budget": 50.0
}
}'
Headers
The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability
The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability
Request body
Response
Successful Response
Changes
Changed in 1 of the 42 revisions of this API.10
- ○
added the new optional request property
//new-optional-request-property
- ○
added the new optional request property
//new-optional-request-property
- ○
added the new optional request property
////new-optional-request-property
- ○
added the new optional request property
//new-optional-request-property
- ○
added the new optional request property
///new-optional-request-property
- ○
added the new optional request property
///new-optional-request-property
- ○
added the new optional request property
/////new-optional-request-property
- ○
added the new optional request property
///new-optional-request-property
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○