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

# Upsert accounts on a custom connection

> Creates or updates accounts on a custom connection, keyed by `external_id` (the client id, stored as the connection object id). Idempotent: re-sending the same `external_id` updates in place.



## OpenAPI

````yaml /api-reference/platform-api.json post /v2/account-connections/{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.27
  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.
paths:
  /v2/account-connections/{id}/accounts:
    post:
      tags:
        - Account Connections
      summary: Upsert accounts on a custom connection
      description: >-
        Creates or updates accounts on a custom connection, keyed by
        `external_id` (the client id, stored as the connection object id).
        Idempotent: re-sending the same `external_id` updates in place.
      operationId: upsertAccounts
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertCustomAccountsDto'
      responses:
        '201':
          description: ''
components:
  schemas:
    UpsertCustomAccountsDto:
      type: object
      properties:
        accounts:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/CustomAccountInputDto'
      required:
        - accounts
    CustomAccountInputDto:
      type: object
      properties:
        external_id:
          type: string
          maxLength: 256
          example: TRUST-1180
          description: Client id; unique on this connection
        name:
          type: string
          maxLength: 512
          example: Trust 1180 vault 3
        type:
          type: string
          enum:
            - eoa
            - multisig
            - contract
            - custodian
            - exchange
            - bank
            - defi
          description: Account type; defaults to the connection default (`bank`).
        network:
          type: string
          maxLength: 255
          example: ethereum
        address:
          type: string
          maxLength: 255
          example: 0xa0b8...
          description: >-
            Optional on-chain address. Does not turn this into an
            address-watched EOA.
        books:
          type: string
          enum:
            - house
            - client
          description: Which books this account sits on (`house` or `client`).
      required:
        - external_id
        - name
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.

````