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

# Create account or ledger connection

> Stores connection credentials. Account providers support preview/import; ledger providers (e.g. quickbooks) store OAuth tokens only. For multisig providers (safe, squads, realms), an address that fails to resolve returns a classified error body `{ statusCode, error, code, message }` with `code` one of: `invalid_address` (bad format), `multisig_not_found` (well-formed address, no multisig there), `wrong_network` (Safe only — exists, but on a different chain than selected), `upstream_unavailable` (the provider/RPC failed — transient, safe to retry).



## OpenAPI

````yaml /api-reference/platform-api.json post /v2/account-connections
openapi: 3.0.0
info:
  title: Range Platform API
  description: >-
    The Range Platform API for workspace management, counterparties, and
    operational tooling.
  version: 1.7.15
  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:
    post:
      tags:
        - Account Connections
      summary: Create account or ledger connection
      description: >-
        Stores connection credentials. Account providers support preview/import;
        ledger providers (e.g. quickbooks) store OAuth tokens only. For multisig
        providers (safe, squads, realms), an address that fails to resolve
        returns a classified error body `{ statusCode, error, code, message }`
        with `code` one of: `invalid_address` (bad format), `multisig_not_found`
        (well-formed address, no multisig there), `wrong_network` (Safe only —
        exists, but on a different chain than selected), `upstream_unavailable`
        (the provider/RPC failed — transient, safe to retry).
      operationId: createConnection
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountConnectionDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountConnectionDto'
components:
  schemas:
    CreateAccountConnectionDto:
      type: object
      properties:
        name:
          type: string
        type:
          type: object
          enum:
            - utila
            - kraken
            - binance
            - okx
            - bybit
            - bitget
            - gate
            - kucoin
            - plaid
            - squads
            - altitude
            - coinbase
            - realms
            - wise
            - safe
            - hyperliquid
            - cubist
            - privy
            - dfns
            - anchorage
            - revolut_business
            - turnkey
            - octav
            - fordefi
            - coins_ph
            - fireblocks
            - pave_bank
            - quickbooks
        utila:
          $ref: '#/components/schemas/CreateAccountConnectionUtilaCredentialsDto'
        kraken:
          $ref: '#/components/schemas/CreateAccountConnectionKrakenCredentialsDto'
        binance:
          $ref: '#/components/schemas/CreateAccountConnectionBinanceCredentialsDto'
        okx:
          $ref: '#/components/schemas/CreateAccountConnectionOkxCredentialsDto'
        bybit:
          $ref: '#/components/schemas/CreateAccountConnectionBybitCredentialsDto'
        bitget:
          $ref: '#/components/schemas/CreateAccountConnectionBitgetCredentialsDto'
        gate:
          $ref: '#/components/schemas/CreateAccountConnectionGateCredentialsDto'
        kucoin:
          $ref: '#/components/schemas/CreateAccountConnectionKucoinCredentialsDto'
        plaid:
          $ref: '#/components/schemas/CreateAccountConnectionPlaidCredentialsDto'
        squads:
          $ref: '#/components/schemas/CreateAccountConnectionSquadsCredentialsDto'
        altitude:
          $ref: '#/components/schemas/CreateAccountConnectionAltitudeCredentialsDto'
        coinbase:
          $ref: '#/components/schemas/CreateAccountConnectionCoinbaseCredentialsDto'
        realms:
          $ref: '#/components/schemas/CreateAccountConnectionRealmsCredentialsDto'
        safe:
          $ref: '#/components/schemas/CreateAccountConnectionSafeCredentialsDto'
        wise:
          $ref: '#/components/schemas/CreateAccountConnectionWiseCredentialsDto'
        hyperliquid:
          $ref: >-
            #/components/schemas/CreateAccountConnectionHyperliquidCredentialsDto
        cubist:
          $ref: '#/components/schemas/CreateAccountConnectionCubistCredentialsDto'
        anchorage:
          $ref: '#/components/schemas/CreateAccountConnectionAnchorageCredentialsDto'
        privy:
          $ref: '#/components/schemas/CreateAccountConnectionPrivyCredentialsDto'
        dfns:
          $ref: '#/components/schemas/CreateAccountConnectionDfnsCredentialsDto'
        revolut_business:
          $ref: >-
            #/components/schemas/CreateAccountConnectionRevolutBusinessCredentialsDto
        turnkey:
          $ref: '#/components/schemas/CreateAccountConnectionTurnkeyCredentialsDto'
        octav:
          $ref: '#/components/schemas/CreateAccountConnectionOctavCredentialsDto'
        quickbooks:
          $ref: '#/components/schemas/CreateAccountConnectionQuickbooksCredentialsDto'
        fordefi:
          $ref: '#/components/schemas/CreateAccountConnectionFordefiCredentialsDto'
        coins_ph:
          $ref: '#/components/schemas/CreateAccountConnectionCoinsPhCredentialsDto'
        fireblocks:
          $ref: '#/components/schemas/CreateAccountConnectionFireblocksCredentialsDto'
        pave_bank:
          $ref: '#/components/schemas/CreateAccountConnectionPaveBankCredentialsDto'
      required:
        - name
        - type
    AccountConnectionDto:
      type: object
      properties:
        id:
          type: string
          example: conn_abc123
        name:
          type: string
          example: My Utila Account
        type:
          type: string
          example: utila
          enum:
            - utila
            - kraken
            - binance
            - okx
            - bybit
            - bitget
            - gate
            - kucoin
            - plaid
            - squads
            - altitude
            - coinbase
            - realms
            - wise
            - safe
            - hyperliquid
            - cubist
            - privy
            - dfns
            - anchorage
            - revolut_business
            - turnkey
            - octav
            - fordefi
            - coins_ph
            - fireblocks
            - pave_bank
            - quickbooks
        kind:
          type: string
          example: account
          enum:
            - account
            - ledger
          description: >-
            Connection family: `account` (import Range Accounts) or `ledger`
            (bookkeeping).
        public_data:
          type: object
          description: Non-sensitive public metadata
          additionalProperties: true
          example:
            public_key: pk_abc123
        created_at:
          format: date-time
          type: string
          example: '2026-01-01T00:00:00.000Z'
        updated_at:
          format: date-time
          type: string
          example: '2026-01-01T00:00:00.000Z'
          description: >-
            Last **config** edit: creation, rename, or a credential/session
            refresh. Sync deliberately never touches it, so this is not a
            freshness signal — read `last_synced_at` for that.
        last_synced_at:
          format: date-time
          type: string
          nullable: true
          example: '2026-01-01T00:00:00.000Z'
          description: >-
            When a transaction-sync run last *succeeded* for this connection, or
            null if none ever has. Prefer this over `updated_at` for freshness:
            on most providers nothing writes `updated_at` after creation, so it
            would age forever however often the connection syncs (RNG-5128).


            Two caveats before treating it as connection health. Sync is **only
            ever triggered manually** (POST
            /v2/account-connections/transactions/sync); nothing runs it on a
            schedule (RNG-5155), so an old timestamp means nobody asked, not
            that anything is wrong. And for the providers served by the
            transfers endpoint (safe, squads, realms, cubist, privy, turnkey,
            dfns, altitude) a run returns early without contacting the provider
            and is still recorded as a success, so the timestamp moves without
            any data being fetched (RNG-5156).
        sync_status:
          type: string
          nullable: true
          example: succeeded
          enum:
            - running
            - succeeded
            - failed
          description: >-
            Outcome of the most recent sync run, or null before the first one.
            `failed` leaves `last_synced_at` at the last genuinely successful
            run.
      required:
        - id
        - name
        - type
        - kind
        - public_data
        - created_at
        - updated_at
        - last_synced_at
        - sync_status
    CreateAccountConnectionUtilaCredentialsDto:
      type: object
      properties:
        service_account_email:
          type: string
      required:
        - service_account_email
    CreateAccountConnectionKrakenCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
        api_secret:
          type: string
      required:
        - api_key
        - api_secret
    CreateAccountConnectionBinanceCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: Binance API key (read-only)
        api_secret:
          type: string
          description: Binance API secret (read-only)
      required:
        - api_key
        - api_secret
    CreateAccountConnectionOkxCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: OKX API key (read-only)
        api_secret:
          type: string
          description: OKX API secret
        passphrase:
          type: string
          description: Passphrase set when creating the API key
      required:
        - api_key
        - api_secret
        - passphrase
    CreateAccountConnectionBybitCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: Bybit API key (read-only)
        api_secret:
          type: string
          description: Bybit API secret
      required:
        - api_key
        - api_secret
    CreateAccountConnectionBitgetCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: Bitget API key (read-only)
        api_secret:
          type: string
          description: Bitget API secret
        passphrase:
          type: string
          description: Passphrase set when creating the API key
      required:
        - api_key
        - api_secret
        - passphrase
    CreateAccountConnectionGateCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: Gate.io APIv4 key (read-only)
        api_secret:
          type: string
          description: Gate.io APIv4 secret
      required:
        - api_key
        - api_secret
    CreateAccountConnectionKucoinCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: KuCoin API key (read-only, General only)
        api_secret:
          type: string
          description: KuCoin API secret
        passphrase:
          type: string
          description: Passphrase set when creating the API key
        api_key_version:
          type: object
          enum:
            - '2'
            - '3'
          description: >-
            API key version from KuCoin's API Management page. Defaults to '3'
            (current generation).
      required:
        - api_key
        - api_secret
        - passphrase
    CreateAccountConnectionPlaidCredentialsDto:
      type: object
      properties:
        public_token:
          type: string
      required:
        - public_token
    CreateAccountConnectionSquadsCredentialsDto:
      type: object
      properties:
        address:
          type: string
      required:
        - address
    CreateAccountConnectionAltitudeCredentialsDto:
      type: object
      properties:
        address:
          type: string
          description: >-
            Altitude (Squads smart account) address — either the deposit address
            or its Settings account.
          example: H8sdnTKCRKiyrDT8g9pMTzeoihUcEoTNdybakNT81xyQ
      required:
        - address
    CreateAccountConnectionCoinbaseCredentialsDto:
      type: object
      properties:
        key_id:
          type: string
        private_key:
          type: string
      required:
        - key_id
        - private_key
    CreateAccountConnectionRealmsCredentialsDto:
      type: object
      properties:
        address:
          type: string
      required:
        - address
    CreateAccountConnectionSafeCredentialsDto:
      type: object
      properties:
        address:
          type: string
          example: 0xAbCd...1234
          description: EVM Safe address
        network:
          type: string
          example: ethereum
          enum:
            - ethereum
            - arbitrum
            - base
            - optimism
            - polygon
            - bnb
      required:
        - address
        - network
    CreateAccountConnectionWiseCredentialsDto:
      type: object
      properties:
        api_token:
          type: string
        profile_id:
          type: string
      required:
        - api_token
        - profile_id
    CreateAccountConnectionHyperliquidCredentialsDto:
      type: object
      properties:
        address:
          type: string
      required:
        - address
    CreateAccountConnectionCubistCredentialsDto:
      type: object
      properties:
        login_id:
          type: string
        refresh_token:
          type: string
        org_id:
          type: string
        environment:
          type: object
          enum:
            - gamma
            - prod
    CreateAccountConnectionAnchorageCredentialsDto:
      type: object
      properties:
        api_access_key:
          type: string
      required:
        - api_access_key
    CreateAccountConnectionPrivyCredentialsDto:
      type: object
      properties:
        app_id:
          type: string
        app_secret:
          type: string
      required:
        - app_id
        - app_secret
    CreateAccountConnectionDfnsCredentialsDto:
      type: object
      properties:
        token:
          type: string
          description: Dfns service account token
        base_url:
          type: string
          example: https://api.dfns.io
          description: >-
            Dfns API host. Must be an official Dfns cluster: https://api.dfns.io
            (default) or https://api.uae.dfns.io for UAE-hosted orgs.
      required:
        - token
    CreateAccountConnectionRevolutBusinessCredentialsDto:
      type: object
      properties:
        client_id:
          type: string
          example: zfTKV9Eie_...
        refresh_token:
          type: string
          description: Revolut OAuth refresh token
        private_key_pem:
          type: string
          description: RSA private key (PEM) matching the uploaded API certificate
        iss:
          type: string
          example: example.com
          description: >-
            JWT `iss` — the redirect URI host used when the certificate was
            created
        environment:
          type: string
          enum:
            - sandbox
            - production
          example: production
      required:
        - client_id
        - refresh_token
        - private_key_pem
        - iss
    CreateAccountConnectionTurnkeyCredentialsDto:
      type: object
      properties:
        api_private_key:
          type: string
          description: Turnkey API private key (32-byte hex scalar)
        api_public_key:
          type: string
          description: Turnkey API public key (compressed hex)
        organization_id:
          type: string
          description: Turnkey organization id
      required:
        - api_private_key
        - api_public_key
        - organization_id
    CreateAccountConnectionOctavCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: The user's own Octav API key
        addresses:
          minItems: 1
          maxItems: 20
          example:
            - '0x253bef0EE4ab6b539D8D5E9e28Ad05C1e952dBf6'
          description: EVM wallet addresses to track protocol positions for
          type: array
          items:
            type: string
      required:
        - api_key
        - addresses
    CreateAccountConnectionQuickbooksCredentialsDto:
      type: object
      properties:
        code:
          type: string
          description: Authorization code from the Intuit OAuth redirect
        realm_id:
          type: string
          description: QuickBooks company (realm) id from the OAuth redirect
          example: '1234567890'
        state:
          type: string
          description: >-
            CSRF state returned by POST
            /account-connections/quickbooks/authorize-url
      required:
        - code
        - realm_id
        - state
    CreateAccountConnectionFordefiCredentialsDto:
      type: object
      properties:
        api_user_token:
          type: string
          description: >-
            Fordefi API User bearer token, scoped to a read-only / non-signing
            role
      required:
        - api_user_token
    CreateAccountConnectionCoinsPhCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: Coins.ph API key (read-only / USER_DATA)
        api_secret:
          type: string
          description: Coins.ph API secret
      required:
        - api_key
        - api_secret
    CreateAccountConnectionFireblocksCredentialsDto:
      type: object
      properties:
        api_key:
          type: string
          description: Fireblocks API User ID (UUID shown in Console)
        private_key_pem:
          type: string
          description: RSA private key PEM matching the CSR uploaded for this API user
        region:
          type: string
          enum:
            - us
            - eu
            - eu2
            - sandbox
          description: Fireblocks workspace region (selects API base URL)
          default: us
      required:
        - api_key
        - private_key_pem
    CreateAccountConnectionPaveBankCredentialsDto:
      type: object
      properties:
        client_id:
          type: string
          description: Pave Bank OAuth client id
        client_secret:
          type: string
          description: Pave Bank OAuth client secret
        environment:
          type: string
          enum:
            - production
            - sandbox
          description: Pave Bank API environment (selects API base URL)
          default: production
      required:
        - client_id
        - client_secret
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.

````