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

# Add or remove accounts

> Batch add, update, or remove accounts for the caller workspace. Remove returns 404 when the account id is not found in the workspace.



## OpenAPI

````yaml /api-reference/data-api.json put /v2/accounts
openapi: 3.0.0
info:
  title: Range Data API
  description: >-
    The Range Data API for crypto addresses, networks, transactions, and
    entities.
  version: 1.7.9
  contact: {}
servers:
  - url: https://api.range.org
    description: Range API Server
security:
  - Authorization: []
tags:
  - name: Address Information
    description: Get information about a crypto address.
  - name: Entity Information
    description: Get information about entities.
  - name: Network Information
    description: Get information about networks.
  - name: Protocols
    description: Get information about cross-chain protocols.
  - name: Token transfers
    description: Get information about token transfers.
paths:
  /v2/accounts:
    put:
      tags:
        - Accounts
      summary: Add or remove accounts
      description: >-
        Batch add, update, or remove accounts for the caller workspace. Remove
        returns 404 when the account id is not found in the workspace.
      operationId: updateAccounts
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccountsDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateAccountsResponseDto'
components:
  schemas:
    UpdateAccountsDto:
      type: object
      properties:
        operations:
          minItems: 1
          maxItems: 1000
          example:
            - action: add
              account:
                name: Treasury wallet
                network: solana
                address: BJE5MMbqXjVwjAF7oxwPYXnTXDyspzZyt4vwenNw5ruG
                category: Multisig
                group_ids:
                  - uuid-1
            - action: remove
              account:
                network: stellar
                address: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN
          type: array
          items:
            $ref: '#/components/schemas/AccountOperationDto'
      required:
        - operations
    UpdateAccountsResponseDto:
      type: object
      properties:
        acknowledged:
          type: boolean
          example: true
      required:
        - acknowledged
    AccountOperationDto:
      type: object
      properties:
        action:
          type: string
          enum:
            - add
            - remove
            - update
          example: add
        account:
          $ref: '#/components/schemas/AccountDataDto'
      required:
        - action
        - account
    AccountDataDto:
      type: object
      properties:
        id:
          type: string
          example: '123'
        name:
          type: string
          example: Treasury wallet
        type:
          type: string
          enum:
            - eoa
            - multisig
            - contract
            - custodian
            - exchange
            - bank
          example: eoa
          default: eoa
        network:
          type: string
          example: solana
          description: Network identifier, e.g. solana, stellar, eth, usd
        address:
          type: string
          example: BJE5MMbqXjVwjAF7oxwPYXnTXDyspzZyt4vwenNw5ruG
        category:
          type: string
          example: exchange
        group_ids:
          example:
            - uuid-1
            - uuid-2
          type: array
          items:
            type: string
        connection_id:
          type: string
          example: utila-123
          description: Account connection holding this account
        connection_object_id:
          type: string
          example: vaults/abc/wallets/xyz
          description: External object ID (e.g., wallet) from the connection provider
        notes:
          type: string
          example: Primary treasury wallet
        role:
          type: string
          example: Treasury
        balances:
          type: array
          items:
            $ref: '#/components/schemas/AccountBalance'
      required:
        - balances
    AccountBalance:
      type: object
      properties:
        asset:
          type: string
          example: USDC
        amount:
          type: string
          example: '100.50'
          description: Raw quantity reported by the provider, in asset units.
        usd:
          type: string
          nullable: true
          example: '100.50'
          description: >-
            USD equivalent of `amount`. `null` when no USD price is available.
            For fiat accounts, equals `amount`.
        updated_at:
          type: string
          example: '2024-01-01T00:00:00.000Z'
      required:
        - asset
        - amount
        - updated_at
  securitySchemes:
    Authorization:
      scheme: bearer
      bearerFormat: API Key
      description: 'Use Authorization: Bearer <api-key>'
      type: http

````