> ## 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.

# Attach accounts to / detach accounts from an entity

> `add` moves each account onto this entity; `remove` moves it back to `self`. Accounts are never deleted. All operations apply in one transaction, or none do.



## OpenAPI

````yaml /api-reference/platform-api.json put /v2/parties/{id}/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/parties/{id}/accounts:
    put:
      tags:
        - Parties
      summary: Attach accounts to / detach accounts from an entity
      description: >-
        `add` moves each account onto this entity; `remove` moves it back to
        `self`. Accounts are never deleted. All operations apply in one
        transaction, or none do.
      operationId: attachAccounts
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachAccountsDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachAccountsResponseDto'
        '400':
          description: Each account may appear in at most one attach operation
        '404':
          description: Entity not found / Account not found in this workspace
components:
  schemas:
    AttachAccountsDto:
      type: object
      properties:
        operations:
          minItems: 1
          maxItems: 500
          type: array
          items:
            $ref: '#/components/schemas/AccountAttachOperationDto'
      required:
        - operations
    AttachAccountsResponseDto:
      type: object
      properties:
        acknowledged:
          type: boolean
          example: true
        moved:
          type: number
          example: 2
          description: >-
            Accounts whose entity actually changed. An `add` of an account
            already on this entity, or a `remove` of one already on self, counts
            as nothing.
      required:
        - acknowledged
        - moved
    AccountAttachOperationDto:
      type: object
      properties:
        action:
          type: string
          enum:
            - add
            - remove
          example: add
          description: >-
            `add` moves the account onto this entity (off whoever it was on);
            `remove` moves it back to `self`. The account is never deleted.
        account_id:
          type: string
          format: uuid
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      required:
        - action
        - account_id
  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.