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

# Daily custody report (CADOC 5711 prototype)

> Raw address × asset custody rows for the base date: for every regulatory-enabled account in the caller workspace, the newest balance snapshot at or before 23:59 America/Sao_Paulo on `date`. Accounts with no usable snapshot appear with null quantity — missing is reported as missing, never as zero. A date with no snapshots returns empty items, not an error. Rows are not filtered by the workspace token whitelist: a CADOC document must list every custodied asset, so a hidden or unpriced token is reported rather than dropped. With `format=xml` a BCB CADOC 5711 `application/xml` document is returned instead: positions grouped per client × asset × network × custodian (own accounts surface only through the COSIF `contas` block), non-zero shelves only. The XML admits no empty fields — if a compliant document cannot be produced (no PTAX rate, unset policy CNPJ, missing snapshot) the request fails with 422 instead of emitting a partial file. Lines the layout cannot carry (asset without a USD price, quantity over the 42-digit cap) are left out of the document and counted per kind in the `X-Report-Warnings` response header.



## OpenAPI

````yaml /api-reference/platform-api.json get /v2/reports/custody/daily
openapi: 3.0.0
info:
  title: Range Platform API
  description: >-
    The Range Platform API for workspace management, counterparties, and
    operational tooling.
  version: 1.7.21
  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/reports/custody/daily:
    get:
      tags:
        - Reports
      summary: Daily custody report (CADOC 5711 prototype)
      description: >-
        Raw address × asset custody rows for the base date: for every
        regulatory-enabled account in the caller workspace, the newest balance
        snapshot at or before 23:59 America/Sao_Paulo on `date`. Accounts with
        no usable snapshot appear with null quantity — missing is reported as
        missing, never as zero. A date with no snapshots returns empty items,
        not an error. Rows are not filtered by the workspace token whitelist: a
        CADOC document must list every custodied asset, so a hidden or unpriced
        token is reported rather than dropped. With `format=xml` a BCB CADOC
        5711 `application/xml` document is returned instead: positions grouped
        per client × asset × network × custodian (own accounts surface only
        through the COSIF `contas` block), non-zero shelves only. The XML admits
        no empty fields — if a compliant document cannot be produced (no PTAX
        rate, unset policy CNPJ, missing snapshot) the request fails with 422
        instead of emitting a partial file. Lines the layout cannot carry (asset
        without a USD price, quantity over the 42-digit cap) are left out of the
        document and counted per kind in the `X-Report-Warnings` response
        header.
      operationId: getDailyCustodyReport
      parameters:
        - name: date
          required: true
          in: query
          description: >-
            Base date (America/Sao_Paulo calendar). Rows reflect the newest
            snapshot per account at or before 23:59 Brasília on this date.
          schema:
            example: '2026-08-24'
            type: string
        - name: format
          required: false
          in: query
          description: >-
            Response format. `xml` returns a BCB CADOC 5711 `application/xml`
            document: `<documento>` with one `<posicao>` per client × asset ×
            network × custodian (third-party holdings only, quantities summed
            across the client's addresses), plus a `<contas>` block carrying
            only the COSIF shelves with a non-zero balance. Any value the layout
            requires but the data cannot supply fails the request with a 422
            rather than producing a document with empty attributes.
          schema:
            default: json
            type: string
            enum:
              - json
              - xml
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DailyCustodyReportResponseDto'
components:
  schemas:
    DailyCustodyReportResponseDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DailyCustodyReportItemDto'
      required:
        - items
    DailyCustodyReportItemDto:
      type: object
      properties:
        account_id:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        client_tax_id:
          type: string
          nullable: true
          example: '52998224725'
        client_tax_id_type:
          type: string
          nullable: true
          example: cpf
          enum:
            - cpf
            - cnpj
        network:
          type: string
          nullable: true
          example: eth
        address:
          type: string
          nullable: true
          example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        asset_id:
          type: string
          nullable: true
          example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
          description: >-
            On-chain denom (contract address / mint / IBC denom) of the asset.
            Null when the source reports no denom, and on missing-snapshot rows.
        symbol:
          type: string
          nullable: true
          example: ETH
        asset_name:
          type: string
          nullable: true
          example: Ether
          description: >-
            Human-readable asset name from the balance snapshot; falls back to
            the symbol. Maps to CADOC tickerDescricao.
        quantity:
          type: string
          nullable: true
          example: '25.000000000000000000'
          description: >-
            Exact quantity as a decimal string. Null — not "0" — when no
            snapshot exists for the base date (e.g. the network has no readable
            balance source).
        usd_value:
          type: string
          nullable: true
          example: '61250.00'
        price_source:
          type: string
          nullable: true
          example: coingecko
          description: >-
            Pricing product recorded with the balance line (`coingecko`,
            `alchemy`). Null when the resolver tracks no source for the asset
            (Tron) and on missing-snapshot rows; `coingecko` only when the
            snapshot predates source tracking.
        price_updated_at:
          type: string
          nullable: true
          example: '2026-08-24T02:58:00.000Z'
          description: >-
            When the unit price backing `usd_value` was fetched at its source
            (UTC). Null when the price source reported no timestamp or the
            snapshot predates this field.
        brl_value:
          type: string
          nullable: true
          example: '315376.25'
          description: >-
            usd_value converted at fx_rate, as an exact decimal string. Null
            whenever usd_value is null or no PTAX rate is available.
        fx_rate:
          type: string
          nullable: true
          example: '5.149'
          description: >-
            BCB PTAX USD/BRL closing sell quote (cotacaoVenda) for the base
            date, walking back to the most recent business day over
            weekends/holidays. Null when no rate is available.
        fx_source:
          type: string
          example: bcb-ptax
          description: Declared FX source; constant for every row.
        fx_updated_at:
          type: string
          nullable: true
          example: '2026-08-25T16:04:44.000Z'
          description: >-
            When the PTAX bulletin backing fx_rate was published (UTC). A
            timestamp before the base date means the rate was carried back from
            the last business day.
        custodian_code:
          type: string
          nullable: true
          example: Z1234567
        custodian_country:
          type: string
          nullable: true
          example: BR
        snapshot_at:
          type: string
          nullable: true
          example: '2026-08-24T02:59:00.000Z'
          description: >-
            When the underlying snapshot was taken (UTC). Null when the account
            has no snapshot at or before the base instant.
      required:
        - account_id
        - fx_source
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.

````