latestOpenAPI 3.1.02026-08-236994571.1 MB

79928a3d37d3

organization management

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:

  1. Check if organization exists
  2. Creates a new Internal User if the user_id or user_email is not found in LiteLLM_UserTable
  3. Add Internal User to the LiteLLM_OrganizationMembership table
post/organization/member_add

Request body

organization_idstring required
max_budget_in_organizationnumber nullable

Response

Successful Response

organization_idstring required