BerriAI/litellm · error · HTTPException

Team id = {team_id} does not exist. Please use a different t

Error message

Team id = {team_id} does not exist. Please use a different team id.

What it means

POST /team/{team_id}/callback checks that the target team exists before storing callback settings; a missing team means the caller used an unknown or deleted team_id, so a 404 with guidance to pick another id is raised.

Source

Thrown at litellm/proxy/management_endpoints/team_callback_endpoints.py:283

    """
    try:
        from litellm.proxy._types import CommonProxyErrors
        from litellm.proxy.proxy_server import (
            prisma_client,
            proxy_logging_obj,
            user_api_key_cache,
        )

        if prisma_client is None:
            raise HTTPException(
                status_code=500,
                detail={"error": CommonProxyErrors.db_not_connected_error.value},
            )

        # Check if team_id exists already
        _existing_team = await prisma_client.get_data(team_id=team_id, table_name="team", query_type="find_unique")
        if _existing_team is None:
            raise HTTPException(
                status_code=400,
                detail={"error": f"Team id = {team_id} does not exist. Please use a different team id."},
            )

        # IDOR guard: only proxy admins / org admins / team admins of THIS
        # team may write callback credentials. Without this, any
        # authenticated key holder could overwrite another team's logging
        # config (and read back the credentials they wrote).
        await _verify_team_access(
            team_obj=LiteLLM_TeamTable(**_existing_team.model_dump()),
            user_api_key_dict=user_api_key_dict,
        )

        # store team callback settings in metadata
        team_metadata = _existing_team.metadata
        team_callback_settings: list[dict] = team_metadata.get("logging")  # will be dict of type AddTeamCallback
        if team_callback_settings is None or not isinstance(team_callback_settings, list):
            team_callback_settings = []

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use an existing team id; verify via /team/list.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_callback_endpoints.py:283 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/413b36c40e8eb29c. Report an issue: GitHub.