> ## Documentation Index
> Fetch the complete documentation index at: https://docs.montereyfinancial.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List accounts

> Paginated list of accounts scoped to the calling key's organization allowlist. Filter by `organization_id` (returns 403 if out of scope).



## OpenAPI

````yaml /api-reference/external_api.openapi.json get /accounts
openapi: 3.1.0
info:
  title: Monterey External Reporting API
  description: >-
    Org-scoped, API-key-authenticated reporting endpoints for Monterey Financial
    clients.
  version: 0.1.0
servers:
  - url: https://api.montereyfinancial.app
    description: Production
security:
  - BearerApiKey: []
paths:
  /accounts:
    get:
      tags:
        - Accounts
      summary: List accounts
      description: >-
        Paginated list of accounts scoped to the calling key's organization
        allowlist. Filter by `organization_id` (returns 403 if out of scope).
      operationId: list_accounts_accounts_get
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Organization Id
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque pagination cursor from a previous response's
              `page.next_cursor`. Omit on the first page.
            title: Cursor
          description: >-
            Opaque pagination cursor from a previous response's
            `page.next_cursor`. Omit on the first page.
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000
                minimum: 1
              - type: 'null'
            description: >-
              Page size for cursor pagination. Default 100, minimum 1, maximum
              1000. Requests above the maximum return 422 — narrow your page
              size and use the returned `next_cursor` to walk additional pages.
            title: Limit
          description: >-
            Page size for cursor pagination. Default 100, minimum 1, maximum
            1000. Requests above the maximum return 422 — narrow your page size
            and use the returned `next_cursor` to walk additional pages.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_AccountRow_'
        '401':
          description: Missing or invalid API key.
        '403':
          description: organization_id outside the key's allowlist.
        '404':
          description: Resource not in scope or does not exist.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerApiKey: []
components:
  schemas:
    Page_AccountRow_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AccountRow'
          type: array
          title: Items
        page:
          $ref: '#/components/schemas/PageMeta'
      type: object
      required:
        - items
        - page
      title: Page[AccountRow]
      description: 'A page of results: `items` plus a `page` pagination envelope.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: >-
        Parameter-validation error (HTTP 422). `detail` lists each violated
        constraint with its location, message, and type.
    AccountRow:
      properties:
        id:
          type: string
          title: Id
        organization_id:
          type: string
          title: Organization Id
          description: >-
            The organization the account belongs to. Same value on every row for
            that organization.
        contract_id:
          type: string
          title: Contract Id
        primary_borrower_party_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Primary Borrower Party Id
          description: The person who is the primary borrower on this account.
        external_account_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: External Account Number
          description: >-
            Account number assigned by the source loan management system. Stable
            for the account's lifetime; useful for cross-referencing LMS-side
            exports.
        external_contract_number:
          anyOf:
            - type: string
            - type: 'null'
          title: External Contract Number
          description: >-
            Contract identifier you/your systems pass to Monterey at account
            creation — the canonical join key back to your systems.
        status_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Code
          description: >-
            Short code for the account's current status (e.g. OPEN, CHARGED_OFF,
            PAID_IN_FULL).
        current_balance_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Current Balance Cents
          description: Current outstanding balance in integer cents.
        past_due_amount_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Past Due Amount Cents
          description: Amount past due in integer cents.
        payoff_amount_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Payoff Amount Cents
          description: Amount required to pay off the account in full, in integer cents.
        payment_amount_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Payment Amount Cents
          description: Scheduled per-period payment amount in integer cents.
        payment_frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Frequency
          description: Cadence of scheduled payments (e.g. 'monthly', 'biweekly').
        last_payment_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Last Payment At
          description: Date of the most recent payment received.
        next_payment_due_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Next Payment Due At
          description: Due date of the next scheduled payment.
        payments_made:
          anyOf:
            - type: integer
            - type: 'null'
          title: Payments Made
        interest_rate_bps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Interest Rate Bps
          description: >-
            Annual interest rate in basis points; divide by 10000 for the
            decimal rate.
        apr_bps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Apr Bps
          description: >-
            Annual percentage rate in basis points; divide by 10000 for the
            decimal rate.
        interest_start_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Interest Start At
        days_past_due_30:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days Past Due 30
          description: >-
            Days the account has spent in the 1–30 days-past-due delinquency
            bucket.
        days_past_due_60:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days Past Due 60
          description: >-
            Days the account has spent in the 31–60 days-past-due delinquency
            bucket.
        days_past_due_90:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days Past Due 90
          description: >-
            Days the account has spent in the 61–90 days-past-due delinquency
            bucket.
        nsf_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Nsf Count
          description: Number of non-sufficient-funds (NSF) events on this account.
        opened_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Opened At
          description: Date the account was opened / activated.
        closed_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Closed At
          description: Date the account was closed. Null if still open.
      type: object
      required:
        - id
        - organization_id
        - contract_id
      title: AccountRow
      description: |-
        Row shape for GET /accounts (list) and the nested
        GET /persons/{id}/accounts. Stays narrow — no joins beyond the
        status code lookup, no computed fields. For richer per-account
        data use GET /accounts/{id} (returns AccountDetailRow).
      examples:
        - apr_bps: 2142
          contract_id: 01J7XY1W2V3U4T5S6R7Q8P9N0M
          current_balance_cents: 845000
          days_past_due_30: 0
          days_past_due_60: 0
          days_past_due_90: 0
          external_account_number: 1004782
          external_contract_number: CTR-2023-00441
          id: 01J9ZQ8H7Z3K8M4N5P6Q7R8S9T
          interest_rate_bps: 1999
          last_payment_at: '2026-04-15'
          next_payment_due_at: '2026-05-15'
          nsf_count: 1
          opened_at: '2024-11-01'
          organization_id: 01J8AB2C3D4E5F6G7H8J9K0L1M
          past_due_amount_cents: 0
          payment_amount_cents: 25000
          payment_frequency: monthly
          payments_made: 18
          payoff_amount_cents: 851200
          primary_borrower_party_id: 01J6WV0U1T2S3R4Q5P6N7M8L9K
          status_code: OPEN
    PageMeta:
      properties:
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Opaque token to pass as ?cursor= to fetch the next page.
        has_more:
          type: boolean
          title: Has More
          description: True if more rows exist past this page.
        limit:
          type: integer
          title: Limit
          description: Echo of the resolved page size.
      type: object
      required:
        - has_more
        - limit
      title: PageMeta
      description: >-
        Pagination envelope on list responses. `next_cursor` is non-null when
        more rows exist — pass it back as `cursor` to continue.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      description: >-
        A single parameter-validation failure: `loc` is the path to the
        offending input, `msg` is human-readable, and `type` is the rule that
        failed.
  securitySchemes:
    BearerApiKey:
      type: http
      description: Static API key issued via the client portal. Treat it like a password.
      scheme: bearer
      bearerFormat: ApiKey

````