Member add
Organization Member Add
[BETA]
Add new members (either via user_email or user_id) to an organization
If user doesn't exist, new user row will also be added to User Table
Only proxy_admin or org_admin of organization, allowed to access this endpoint.
Parameters:
- organization_id: str (required)
- member: Union[List[Member], Member] (required)
- role: Literal[LitellmUserRoles] (required)
- user_id: Optional[str]
- user_email: Optional[str]
Note: Either user_id or user_email must be provided for each member.
Example:
curl -X POST 'http://0.0.0.0:4000/organization/member_add' -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d '{
"organization_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849",
"member": {
"role": "internal_user",
"user_id": "krrish247652@berri.ai"
},
"max_budget_in_organization": 100.0
}'
The following is executed in this function:
- Check if organization exists
- Creates a new Internal User if the user_id or user_email is not found in LiteLLM_UserTable
- Add Internal User to the
LiteLLM_OrganizationMembership
table
POST/organization/member_add
Authorization
Body
member*Member
organization_id*Organization Id
max_budget_in_organizationMax Budget In Organization
Response
Successful Response
Body
organization_id*Organization Id
updated_users*Updated Users
updated_organization_memberships*Updated Organization Memberships
Request
Response