{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/immix/json-schema/immix-accounts-list-accounts-response-schema.json",
  "title": "ListAccountsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/immix-accounts-api-openapi.yml#/components/schemas/accounts_ListAccountsResponse",
  "type": "object",
  "properties": {
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `cursor` for the next page. Null on the last page."
    },
    "prevCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `cursor` for the previous page. Null on the first page."
    },
    "total": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Exact count matching the filter. Null unless `include=total`."
    },
    "globalSequence": {
      "$ref": "#/$defs/GlobalSequenceValue"
    },
    "asOfSeqTsNs": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9]+$",
      "description": "The sequencer timestamp (epoch-ns) the data is complete through; also sent as X-Immix-As-Of-Seq-Ts. Null when unknown."
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AccountUpdated"
      }
    },
    "unscaled": {
      "type": "boolean",
      "description": "Never present since 0.3.3: every money value on this API states its own scale on the wire, so no item is ever served raw — the coarse collection form of RowExtras.unscaled, retired with it. Kept, deprecated, so a client generated from 0.3.2 still compiles.",
      "deprecated": true
    }
  },
  "required": [
    "nextCursor",
    "prevCursor",
    "total",
    "globalSequence",
    "asOfSeqTsNs",
    "items"
  ],
  "$defs": {
    "AccountUpdated": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "integer",
          "description": "Sticky entity key."
        },
        "version": {
          "type": "string",
          "pattern": "^-?[0-9]+$",
          "description": "Monotonic per entity. int64 as a decimal JSON string"
        },
        "orgId": {
          "type": "integer",
          "description": "The owning org — stamped by the owner from the credential's org, never client-supplied."
        },
        "credentialId": {
          "type": "integer",
          "description": "The pipe this account is reached through."
        },
        "status": {
          "$ref": "#/$defs/AccountUpdatedStatus",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "location": {
          "$ref": "#/$defs/AccountUpdatedLocation",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "ownership": {
          "$ref": "#/$defs/AccountUpdatedOwnership",
          "description": "HOUSE only exercised in the POC. UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "purpose": {
          "$ref": "#/$defs/AccountUpdatedPurpose",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "temperature": {
          "$ref": "#/$defs/AccountUpdatedTemperature",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "portfolioId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Single assignment in the POC; 0 = unassigned."
        },
        "pendingByUserId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The maker while a proposal is pending; 0 otherwise."
        },
        "pendingTransition": {
          "$ref": "#/$defs/AccountUpdatedPendingTransition",
          "description": "ACTIVATE (a classification), AMEND (a re-classification — the proposed axes ride this record while the last approved record keeps enforcing), UNFREEZE, RETIRE; NONE otherwise. NONE is the unset sentinel: outputs only — as input, omit the field instead; explicit NONE refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as NONE, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "tradingCredentialId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The trading credential this account's orders go through when set (a read-only key discovers the account; a trading key at the same venue is designated here); absent or 0 = orders go through credentialId. Designated at classification, under dual control."
        },
        "externalRef": {
          "type": "string",
          "description": "The venue's own account identifier — an attribute, never the id; with the credential, the key a discovery is idempotent on."
        },
        "displayName": {
          "type": "string",
          "description": "Empty-not-null."
        }
      },
      "required": [
        "accountId",
        "version",
        "orgId",
        "credentialId",
        "status",
        "location",
        "ownership",
        "purpose",
        "temperature",
        "pendingTransition",
        "externalRef",
        "displayName"
      ],
      "title": "AccountUpdated"
    },
    "AccountUpdatedLocation": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "EXCHANGE",
        "CUSTODIAN",
        "WALLET",
        "SELF_HOSTED",
        "BANK"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedLocation"
    },
    "AccountUpdatedOwnership": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "HOUSE",
        "CLIENT_OMNIBUS",
        "CLIENT_SEGREGATED"
      ],
      "description": "HOUSE only exercised in the POC. UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedOwnership"
    },
    "AccountUpdatedPendingTransition": {
      "type": "string",
      "enum": [
        "NONE",
        "ACTIVATE",
        "AMEND",
        "REACTIVATE",
        "UNFREEZE",
        "RETIRE",
        "REVOKE",
        "ROTATE",
        "RESUME_TRADING"
      ],
      "description": "ACTIVATE (a classification), AMEND (a re-classification — the proposed axes ride this record while the last approved record keeps enforcing), UNFREEZE, RETIRE; NONE otherwise. NONE is the unset sentinel: outputs only — as input, omit the field instead; explicit NONE refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as NONE, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedPendingTransition"
    },
    "AccountUpdatedPurpose": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "TREASURY",
        "CLIENT_DEPOSIT",
        "SETTLEMENT_OPS",
        "COLLATERAL",
        "HEDGE",
        "RAIL_VISIBLE"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedPurpose"
    },
    "AccountUpdatedStatus": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "DISCOVERED",
        "PENDING_APPROVAL",
        "ACTIVE",
        "FROZEN",
        "RETIRED"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedStatus"
    },
    "AccountUpdatedTemperature": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "COLD",
        "WARM",
        "HOT"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedTemperature"
    },
    "GlobalSequenceValue": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.",
      "title": "GlobalSequenceValue"
    }
  }
}