Modern Treasury Counterparties API

Manage counterparties, external accounts, and routing details.

OpenAPI Specification

modern-treasury-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Modern Treasury
  version: v1
  contact:
    name: Modern Treasury Engineering Team
    url: https://moderntreasury.com
  description: The Modern Treasury REST API. Please see https://docs.moderntreasury.com for more details.
paths:
  /api/ledger_account_balance_monitors:
    get:
      summary: list ledger_account_balance_monitors
      tags:
        - LedgerAccountBalanceMonitor
      operationId: listLedgerAccountBalanceMonitors
      description: Get a list of ledger account balance monitors.
      security:
        - basic_auth: []
      parameters:
        - name: after_cursor
          in: query
          schema:
            type: string
            nullable: true
          required: false
        - name: per_page
          in: query
          schema:
            type: integer
          required: false
        - $ref: '#/components/parameters/metadata_query'
        - $ref: '#/components/parameters/bulk_id'
        - name: ledger_account_id
          in: query
          schema:
            type: string
          description: Query the balance monitors for a single ledger account.
          required: false
      responses:
        '200':
          description: successful
          headers:
            X-After-Cursor:
              schema:
                type: string
                nullable: true
              required: false
              description: >-
                The cursor for the next page. Including this in a call as `after_cursor` will return the next
                page.
            X-Per-Page:
              schema:
                type: integer
                nullable: true
              description: The current `per_page`.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ledger_account_balance_monitor'
    post:
      summary: create ledger_account_balance_monitor
      tags:
        - LedgerAccountBalanceMonitor
      operationId: createLedgerAccountBalanceMonitor
      description: Create a ledger account balance monitor.
      security:
        - basic_auth: []
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: This key should be something unique, preferably something like an UUID.
          schema:
            type: string
      responses:
        '201':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_balance_monitor'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_balance_monitor_create_request'
  /api/ledger_account_balance_monitors/{id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
        description: id
        required: true
    get:
      summary: get ledger_account_balance_monitor
      tags:
        - LedgerAccountBalanceMonitor
      operationId: getLedgerAccountBalanceMonitor
      description: Get details on a single ledger account balance monitor.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_balance_monitor'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
    patch:
      summary: update ledger_account_balance_monitor
      tags:
        - LedgerAccountBalanceMonitor
      operationId: updateLedgerAccountBalanceMonitor
      description: Update a ledger account balance monitor.
      security:
        - basic_auth: []
      parameters: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_balance_monitor'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_balance_monitor_update_request'
    delete:
      summary: delete ledger_account_balance_monitor
      tags:
        - LedgerAccountBalanceMonitor
      operationId: deleteLedgerAccountBalanceMonitor
      description: Delete a ledger account balance monitor.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_balance_monitor'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
  /api/ledger_account_categories:
    get:
      summary: list ledger_account_categories
      tags:
        - LedgerAccountCategory
      operationId: listLedgerAccountCategories
      description: Get a list of ledger account categories.
      security:
        - basic_auth: []
      parameters:
        - name: after_cursor
          in: query
          schema:
            type: string
            nullable: true
          required: false
        - name: per_page
          in: query
          schema:
            type: integer
          required: false
        - $ref: '#/components/parameters/metadata_query'
        - $ref: '#/components/parameters/bulk_id'
        - name: name
          in: query
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/bulk_name'
        - name: ledger_id
          in: query
          schema:
            type: string
          required: false
        - name: currency
          in: query
          required: false
          schema:
            type: string
        - name: external_id
          in: query
          schema:
            type: string
          required: false
        - name: parent_ledger_account_category_id
          in: query
          schema:
            type: string
          required: false
          description: Query categories that are nested underneath a parent category
        - name: ledger_account_id
          in: query
          schema:
            type: string
          required: false
          description: Query categories which contain a ledger account directly or through child categories.
        - name: balances
          in: query
          schema:
            type: object
            properties:
              effective_at:
                type: string
                format: date-time
            additionalProperties: false
          style: deepObject
          required: false
          description: >-
            For example, if you want the balances as of a particular time (ISO8601), the encoded query string
            would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`. The balances as of a time are
            inclusive of entries with that exact time, but with respect to the ledger accounts that are
            currently present in the category.
          explode: true
      responses:
        '200':
          description: successful
          headers:
            X-After-Cursor:
              schema:
                type: string
                nullable: true
              required: false
              description: >-
                The cursor for the next page. Including this in a call as `after_cursor` will return the next
                page.
            X-Per-Page:
              schema:
                type: integer
                nullable: true
              description: The current `per_page`.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ledger_account_category'
    post:
      summary: create ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: createLedgerAccountCategory
      description: Create a ledger account category.
      security:
        - basic_auth: []
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: This key should be something unique, preferably something like an UUID.
          schema:
            type: string
      responses:
        '201':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_category'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_category_create_request'
  /api/ledger_account_categories/{id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
        description: id
        required: true
    get:
      summary: get ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: getLedgerAccountCategory
      description: Get the details on a single ledger account category.
      security:
        - basic_auth: []
      parameters:
        - name: balances
          in: query
          schema:
            type: object
            properties:
              as_of_date:
                type: string
                format: date
              effective_at:
                type: string
                format: date-time
            additionalProperties: false
          style: deepObject
          required: false
          description: >-
            For example, if you want the balances as of a particular time (ISO8601), the encoded query string
            would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`. The balances as of a time are
            inclusive of entries with that exact time, but with respect to the ledger accounts that are
            currently present in the category.
          explode: true
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_category'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
    patch:
      summary: update ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: updateLedgerAccountCategory
      description: Update the details of a ledger account category.
      security:
        - basic_auth: []
      parameters: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_category'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '409':
          description: conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_category_update_request'
    delete:
      summary: delete ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: deleteLedgerAccountCategory
      description: Delete a ledger account category.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_category'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
  /api/ledger_account_categories/{id}/ledger_accounts/{ledger_account_id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
        description: id
        required: true
      - name: ledger_account_id
        in: path
        schema:
          type: string
        description: ledger_account_id
        required: true
    put:
      summary: add ledger_account to ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: addLedgerAccountToLedgerAccountCategory
      description: Add a ledger account to a ledger account category.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
    delete:
      summary: remove ledger_account from ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: removeLedgerAccountFromLedgerAccountCategory
      description: Remove a ledger account from a ledger account category.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
  /api/ledger_account_categories/{id}/ledger_account_categories/{sub_category_id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
        description: id
        required: true
      - name: sub_category_id
        in: path
        schema:
          type: string
        description: sub_category_id
        required: true
    put:
      summary: add ledger_account_category to ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: addLedgerAccountCategoryToLedgerAccountCategory
      description: Add a ledger account category to a ledger account category.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
    delete:
      summary: delete ledger_account_category from ledger_account_category
      tags:
        - LedgerAccountCategory
      operationId: deleteLedgerAccountCategoryFromLedgerAccountCategory
      description: Delete a ledger account category from a ledger account category.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
  /api/ledger_account_settlements/{id}/ledger_entries:
    parameters:
      - name: id
        in: path
        description: id
        required: true
        schema:
          type: string
    patch:
      summary: patch ledger_account_settlement_entries
      tags:
        - LedgerAccountSettlement
      operationId: patchLedgerAccountSettlementEntries
      description: Add ledger entries to a draft ledger account settlement.
      security:
        - basic_auth: []
      parameters: []
      responses:
        '200':
          description: successful
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_settlement_entries_patch_request'
    delete:
      summary: delete ledger_account_settlement_entries
      tags:
        - LedgerAccountSettlement
      operationId: deleteLedgerAccountSettlementEntries
      description: Remove ledger entries from a draft ledger account settlement.
      security:
        - basic_auth: []
      parameters: []
      responses:
        '200':
          description: successful
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_settlement_entries_delete_request'
  /api/ledger_account_settlements:
    post:
      summary: create ledger_account_settlement
      tags:
        - LedgerAccountSettlement
      operationId: createLedgerAccountSettlement
      description: Create a ledger account settlement.
      security:
        - basic_auth: []
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: This key should be something unique, preferably something like an UUID.
          schema:
            type: string
      responses:
        '201':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_settlement'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_settlement_create_request'
    get:
      summary: list ledger_account_settlements
      tags:
        - LedgerAccountSettlement
      operationId: listLedgerAccountSettlements
      description: Get a list of ledger account settlements.
      security:
        - basic_auth: []
      parameters:
        - name: after_cursor
          in: query
          schema:
            type: string
            nullable: true
          required: false
        - name: per_page
          in: query
          schema:
            type: integer
          required: false
        - $ref: '#/components/parameters/metadata_query'
        - $ref: '#/components/parameters/bulk_id'
        - name: settled_ledger_account_id
          in: query
          schema:
            type: string
          required: false
        - name: settlement_entry_direction
          in: query
          schema:
            type: string
          required: false
        - name: ledger_transaction_id
          in: query
          schema:
            type: string
          required: false
        - name: ledger_id
          in: query
          schema:
            type: string
          required: false
        - name: created_at
          in: query
          schema:
            type: object
            additionalProperties:
              type: string
              format: date-time
          style: deepObject
          required: false
          description: >-
            Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the created at timestamp.
            For example, for all times after Jan 1 2000 12:00 UTC, use
            created_at%5Bgt%5D=2000-01-01T12:00:00Z.
          explode: true
        - name: updated_at
          in: query
          schema:
            type: object
            additionalProperties:
              type: string
              format: date-time
          style: deepObject
          required: false
          description: >-
            Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the updated at timestamp.
            For example, for all times after Jan 1 2000 12:00 UTC, use
            updated_at%5Bgt%5D=2000-01-01T12:00:00Z.
          explode: true
      responses:
        '200':
          description: successful
          headers:
            X-After-Cursor:
              schema:
                type: string
                nullable: true
              required: false
              description: >-
                The cursor for the next page. Including this in a call as `after_cursor` will return the next
                page.
            X-Per-Page:
              schema:
                type: integer
                nullable: true
              description: The current `per_page`.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ledger_account_settlement'
  /api/ledger_account_settlements/{id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
        description: id
        required: true
    get:
      summary: get ledger_account_settlement
      tags:
        - LedgerAccountSettlement
      operationId: getLedgerAccountSettlement
      description: Get details on a single ledger account settlement.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_settlement'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
    patch:
      summary: update ledger_account_settlement
      tags:
        - LedgerAccountSettlement
      operationId: updateLedgerAccountSettlement
      description: Update the details of a ledger account settlement.
      security:
        - basic_auth: []
      parameters: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_settlement'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_settlement_update_request'
  /api/ledger_account_statements:
    post:
      summary: create ledger_account_statement
      tags:
        - LedgerAccountStatement
      operationId: createLedgerAccountStatement
      description: Create a ledger account statement.
      security:
        - basic_auth: []
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: This key should be something unique, preferably something like an UUID.
          schema:
            type: string
      responses:
        '201':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_statement'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ledger_account_statement_create_request'
  /api/ledger_account_statements/{id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
        description: id
        required: true
    get:
      summary: get ledger_account_statement
      tags:
        - LedgerAccountStatement
      operationId: getLedgerAccountStatement
      description: Get details on a single ledger account statement.
      security:
        - basic_auth: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ledger_account_statement'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
  /api/ledger_accounts:
    get:
      summary: list ledger_accounts
      tags:
        - LedgerAccount
      operationId: listLedgerAccounts
      description: Get a list of ledger accounts.
      security:
        - basic_auth: []
      parameters:
        - name: after_cursor
          in: query
          schema:
            type: string
            nullable: true
          required: false
        - name: per_page
          in: query
          schema:
            type: integer
          required: false
        - $ref: '#/components/parameters/metadata_query'
        - $ref: '#/components/parameters/bulk_id'
        - $ref: '#/components/parameters/bulk_name'
        - name: ledger_id
          in: query
          schema:
            type: string
          required: false
        - name: external_id
          in: query
          schema:
            type: string
          required: false
        - name: currency
          in: query
          required: false
          schema:
            type: string
        - name: balances
          in: query
          schema:
            type: object
            properties:
              as_of_date:
                type: string
                format: date
              effective_at:
                type: string
                format: date-time
              effective_at_lower_bound:
                type: string
                format: date-time
              effective_at_upper_bound:
                type: string
                format: date-time
            additionalProperties: false
          style: deepObject
          required: false
          description: >-
            Use `balances[effective_at_lower_bound]` and `balances[effective_at_upper_bound]` to get the
            balances change between the two timestamps. The lower bound is inclusive while the upper bound is
            exclusive of the provided timestamps. If no value is supplied the balances will be retrieved not
            including that bound.
          explode: true
        - name: pending_balance_amount
          in: query
          schema:
            type: object
            properties:
              gt:
                type: integer
              lt:
                type: integer
              gte:
                type: integer
              lte:
                type: integer
              eq:
                type: integer
              not_eq:
                type: integer
            additionalProperties: false
          style: deepObject
          required: false
          description: >-
            Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to filter by balance
            amount.
          explode: true
        - name: posted_balance_amount
          in: query
          schema:
            type: object
            properties:
              gt:
                type: integer
              lt:
                type: integer
              gte:
                type: integer
              lte:
                type: integer
              eq:
                type: integer
              not_eq:
                type: integer
            additionalProperties: false
          style: deepObject
          required: false
          description: >-
            Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to filter by balance
            amount.
          explode: true
        - name: available_balance_amount
          in: query
          schema:
            type: object
            properties:
              gt:
               

# --- truncated at 32 KB (673 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/modern-treasury/refs/heads/main/openapi/modern-treasury-openapi.yml