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

# Detach every account from a team

> Sets team_id to null on every account of the caller workspace that is in the given team. Admin session only. Called by range-app after a team is deleted, so the team is NOT required to still exist; an unknown or already-empty team detaches zero accounts.



## OpenAPI

````yaml /api-reference/platform-api.json delete /v2/teams/{teamId}/accounts
openapi: 3.0.0
info:
  title: Range Platform API
  description: >-
    The Range Platform API for workspace management, counterparties, and
    operational tooling.
  version: 1.7.29
  contact: {}
servers:
  - url: https://api.range.org
    description: Range API Server
security:
  - Authorization: []
  - Authorization: []
tags:
  - name: Address Information
    description: Get information about a crypto address.
  - name: Transfer Enrichments
    description: Attach workspace-scoped notes and categories to transfers.
  - name: Counterparties
    description: Manage external entities, their addresses, bank accounts, and documents.
  - name: Parties
    description: >-
      The workspace entity register: the firm itself, its clients, and its
      counterparties.
paths:
  /v2/teams/{teamId}/accounts:
    delete:
      tags:
        - Accounts
      summary: Detach every account from a team
      description: >-
        Sets team_id to null on every account of the caller workspace that is in
        the given team. Admin session only. Called by range-app after a team is
        deleted, so the team is NOT required to still exist; an unknown or
        already-empty team detaches zero accounts.
      operationId: detachTeamAccounts
      parameters:
        - name: teamId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetachTeamAccountsResponseDto'
components:
  schemas:
    DetachTeamAccountsResponseDto:
      type: object
      properties:
        accounts_detached:
          type: number
          example: 3
          description: >-
            How many accounts of the caller workspace had this team_id and were
            detached.
      required:
        - accounts_detached
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.