> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove a team user

> Remove a directly assigned team role and reassign the user's team resources.

> [!WARNING]
>
> This endpoint is experimental and may change or be removed without notice.


## OpenAPI

````yaml delete /v1/teams/{team_id}/users/{user_id}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/teams/{team_id}/users/{user_id}:
    parameters:
      - $ref: '#/components/parameters/team_id'
      - $ref: '#/components/parameters/user_id'
    delete:
      summary: Removes a user from a team
      description: >-
        Removes the team role the user was given, which removes them from the
        team, and reassigns their models, chains, and training projects in the
        team to an organization admin. Access through a directory group or from
        being an organization admin remains. Returns 404 when the user wasn't
        given a team role. Users can't be removed from the default team.
        Requires an organization admin. Temporary; may be removed once
        fine-grained access control is available.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamUserTombstoneV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request DELETE \
            --url https://api.baseten.co/v1/teams/{team_id}/users/{user_id} \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/teams/{team_id}/users/{user_id}"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "DELETE",
                url,
                headers=headers,
                json={}
            )

            print(response.text)
components:
  parameters:
    team_id:
      schema:
        type: string
      name: team_id
      in: path
      required: true
    user_id:
      schema:
        type: string
      name: user_id
      in: path
      required: true
  schemas:
    TeamUserTombstoneV1:
      description: A user removed from a team.
      properties:
        team_id:
          description: Unique identifier of the team
          title: Team Id
          type: string
        team_name:
          description: Name of the team
          title: Team Name
          type: string
        user_id:
          description: Unique identifier of the user
          title: User Id
          type: string
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Name of the user, or their email address when they have no name
          title: User Name
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          description: Email address of the user
          title: User Email
      required:
        - team_id
        - team_name
        - user_id
        - user_name
        - user_email
      title: TeamUserTombstoneV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````