---
title: "GET /v1/portfolios/{portfolioSlug}/accounting-rules"
method: GET
path: "/v1/portfolios/{portfolioSlug}/accounting-rules"
tags: ["AccountingRules"]
---

# GET /v1/portfolios/{portfolioSlug}/accounting-rules

`GET /v1/portfolios/{portfolioSlug}/accounting-rules`

## Request

- Base URL: `https://api.tokenbooks.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tokenbooks.io/v1/portfolios/{portfolioSlug}/accounting-rules`
- Auth: API key in header `x-api-key`

## Path parameters

- `portfolioSlug` string, required

## Query parameters

- `pageSize` integer: Requested number of resources to return. Oversized values are clamped to the route limit.
- `pageToken` string: Opaque token returned by the previous list response.
- `search` string: Free-text match against rule names.
- `enabled` boolean: Keep only enabled rules, or only disabled ones. Omit to return both.
- `actionTypes` string[]: Action types as CSV or repeated query values.
- `conditionFields` string[]: Condition fields as CSV or repeated query values.
- `wallets` string[]: Wallet selectors as chainId:walletAddress values.
- `accountNumbers` string[]: Ledger account numbers as CSV or repeated query values.
- `counterpartyNames` string[]: Counterparty names as CSV or repeated query values.
- `assetIds` string[]: Asset ids as CSV or repeated query values.
- `ruleIds` string[]: Exact rule ids as CSV or repeated query values. Duplicate ids are removed.

## Response `200`

- AccountingRulesListResponseDto
  - `data` object[], required
    - `id` string, required
    - `name` string, required
    - `enabled` boolean, required
    - `version` integer, required
    - `conditions` object, nullable, required
      - `formatVersion` 1, required: Structure version of this envelope. Always 1.
      - `all` union[], required: Conditions that must all match for the rule to fire. At least one is required.
        - union
          - object
            - `field` 'fromAddressLabel', required: Which part of the transaction this condition tests.
            - `operator` 'equals' | 'contains' | 'notEquals' | 'notContains', required: How the field is compared with value.
            - `value` string, required: The value the field is compared against.
          - object
            - `field` 'toAddressLabel', required: Which part of the transaction this condition tests.
            - `operator` 'equals' | 'contains' | 'notEquals' | 'notContains', required: How the field is compared with value.
            - `value` string, required: The value the field is compared against.
          - object
            - `field` 'fromAddress', required: Which part of the transaction this condition tests.
            - `operator` 'equals' | 'contains', required: How the field is compared with value.
            - `value` string, required: The value the field is compared against.
          - object
            - `field` 'toAddress', required: Which part of the transaction this condition tests.
            - `operator` 'equals' | 'contains', required: How the field is compared with value.
            - `value` string, required: The value the field is compared against.
          - object
            - `field` 'direction', required: Which part of the transaction this condition tests.
            - `operator` 'equals' | 'notEquals', required: How the field is compared with value.
            - `value` 'IN' | 'OUT' | 'GAS', required: The value the field is compared against.
          - object
            - `field` 'asset', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'assetClass', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'stablecoin', required: Which part of the transaction this condition tests.
            - `operator` 'equals', required: How the field is compared with value.
            - `value` boolean, required: The value the field is compared against.
          - object
            - `field` 'chain', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'operationType', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'accountSubType', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'fiatValue', required: Condition field.
            - `operator` 'gt', required: Comparison operator.
            - `value` string, required: Decimal fiat amount to compare against.
          - object
            - `field` 'fiatValue', required: Condition field.
            - `operator` 'lt', required: Comparison operator.
            - `value` string, required: Decimal fiat amount to compare against.
          - object
            - `field` 'fiatValue', required: Condition field.
            - `operator` 'gte', required: Comparison operator.
            - `value` string, required: Decimal fiat amount to compare against.
          - object
            - `field` 'fiatValue', required: Condition field.
            - `operator` 'lte', required: Comparison operator.
            - `value` string, required: Decimal fiat amount to compare against.
          - object
            - `field` 'fiatValue', required: Condition field.
            - `operator` 'between', required: Comparison operator.
            - `value` union[], required: Inclusive [low, high] decimal-string range.
              - …
          - object
            - `field` 'entryType', required: Which part of the transaction this condition tests.
            - `operator` 'equals', required: How the field is compared with value.
            - `value` 'DR' | 'CR', required: The value the field is compared against.
          - object
            - `field` 'accountType', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'transactionDate', required: Owning transaction timestamp.
            - `operator` 'lt', required: Before (lt) or on or after (gte) the cutoff.
            - `value` string, date-time, required: Exact timestamp with three fractional digits and a known offset or Z; -00:00 is invalid.
          - object
            - `field` 'transactionDate', required: Owning transaction timestamp.
            - `operator` 'gte', required: Before (lt) or on or after (gte) the cutoff.
            - `value` string, date-time, required: Exact timestamp with three fractional digits and a known offset or Z; -00:00 is invalid.
          - object
            - `field` 'transactionDate', required: Owning transaction timestamp.
            - `operator` 'between', required: Within the inclusive [start, end] range.
            - `value` union[], required: Inclusive [start, end] timestamps, earliest first; each has three fractional digits and a known offset or Z, never -00:00.
              - …
          - object
            - `field` 'wallet', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` object[], required: The value the field is compared against.
              - …
          - object
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `field` 'accountNumber', required: Which part of the transaction this condition tests.
            - `value` string[], required: The value the field is compared against.
          - object
            - `field` 'counterparty', required: Which part of the transaction this condition tests.
            - `operator` 'in' | 'notIn', required: How the field is compared with value.
            - `value` string[], required: The value the field is compared against.
    - `action` object, nullable, required
      - `formatVersion` 1, required: Structure version of this envelope. Always 1.
      - `actions` union[], required: What the rule changes when it matches. At most one action of each type.
        - union
          - object
            - `type` 'SET_COUNTERPARTY', required: Which change this action makes.
            - `target` 'LINE', required: What the change applies to: a journal line or the transaction.
            - `counterpartyName` string, nullable, required: Counterparty name, from list_journal_line_assignment_options (type: counterparty).
          - object
            - `type` 'SET_LEDGER_ACCOUNT', required: Which change this action makes.
            - `target` 'LINE', required: What the change applies to: a journal line or the transaction.
            - `accountNumber` string, nullable, required: Chart-of-accounts number, from list_journal_line_assignment_options (type: ledger_account).
          - object
            - `type` 'SET_RESPONSIBILITY_CENTERS', required: Which change this action makes.
            - `target` 'LINE', required: What the change applies to: a journal line or the transaction.
            - `responsibilityCenterAssignments` object[], required
              - …
    - `hasInvalidDefinition` boolean, required
    - `hasUnresolvedReferences` boolean, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
  - `pagination` object, required
    - `pageSize` integer, required: Items returned per page.
    - `nextPageToken` string: Opaque token for retrieving the next page.

---

[API](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api.md) · [All operations](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/revisions/180622e6255e?raw)
