# Search bank accounts

Operation ID: `searchBankAccount`

Group: Banking › Bank Accounts

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/searchBankAccount)

`POST /banking/bank-accounts/search`

Read-only: A read that takes its filters in the body. Changes nothing, and ignores Idempotency-Key.

Searches bank accounts. Only this endpoint can match a bank account by a name or an account number. GET banking/bank-accounts returns names and account numbers but can't filter on them.

Bank accounts deleted with DELETE banking/bank-accounts/:id are never returned.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Request body

Required, `application/json`: searchBankAccountInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | object | no | The filters to apply. A bank account must match every filter you send. Omit to return all bank accounts. Example: `{"type":"checking","paymentAllowed":true}`. |
| `filters.id` | string | no | Limits results to the bank account with this identifier. |
| `filters.externalAccountId` | string | no | Limits results to the bank account with this external identifier. It is unique within the tenant, so at most one account matches. |
| `filters.externalAccountName` | string | no | Limits results to bank accounts with this external account name. The match is exact. |
| `filters.accountId` | string | no | Limits results to the bank account linked to this chart-of-accounts account. See id on GET accounting/accounts/:id. |
| `filters.accountName` | string | no | Limits results to bank accounts whose linked chart-of-accounts account has this name. The match is exact. |
| `filters.accountNumber` | string | no | Limits results to bank accounts whose linked chart-of-accounts account has this number. This is a general-ledger number, not a bank account number. The match is exact. |
| `filters.entityId` | string | no | Limits results to bank accounts owned by this legal entity. See id on GET base/entities. |
| `filters.financialInstitutionId` | string | no | Limits results to bank accounts held at this financial institution. There is no endpoint for it. |
| `filters.type` | string | no | Limits results to bank accounts of this kind, for example 'checking'. The kind is free-form text, so an unknown value matches nothing. |
| `filters.currency` | string | no | Limits results to bank accounts held in this currency. Format ISO 4217, for example 'USD'. |
| `filters.paymentAllowed` | boolean | no | Limits results to accounts payments may be made from when true, and those they may not when false. |
| `filters.receivableAccount` | boolean | no | Limits results to accounts that may receive money when true, and those that may not when false. |
| `filters.isReady` | boolean | no | Limits results to accounts that are fully set up when true, and those that are not when false. |
| `page` | object | no | The pagination controls. Omit for the first page. Example: `{"size":50}`. |
| `page.cursor` | string | no | The cursor from the previous response's pagination.nextCursor. Omit for the first request. |
| `page.size` | number | no | The number of bank accounts per page. Defaults to 50. A value above 200 is treated as 200, not rejected. |

```json
{
  "filters": {
    "type": "checking",
    "paymentAllowed": true
  },
  "page": {
    "size": 50
  }
}
```

## Response

`200` Success

Under `data` (searchBankAccountOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array<object> | yes | The bank accounts on this page, most recently created first. An empty array when nothing matches. |
| `items[].id` | string | yes | The unique identifier for the bank account. |
| `items[].externalAccountId` | string | yes | The identifier this account has in the bank or aggregator it was connected from. Unique within the tenant. |
| `items[].externalAccountName` | string | no | The account name as reported by the bank or aggregator. |
| `items[].externalDescription` | string | no | The account description as reported by the bank or aggregator. |
| `items[].type` | string | no | The kind of account, as free-form text. For example 'checking', 'saving' or 'creditCard'. |
| `items[].currency` | string | no | The currency the account is held in. Format ISO 4217, for example 'USD'. balance is in this currency. |
| `items[].balance` | decimal | no | The current account balance, in currency. |
| `items[].mask` | string | no | A masked form of the account number, for example '****1234'. Display it instead of reference where the full number is not needed. |
| `items[].reference` | string | no | The full account number, the IBAN or the ACH account number. |
| `items[].referenceType` | string | no | How referenceNumber is structured. Possible values: 'QRR', 'SCOR', 'NON'. 'QRR' is a Swiss QR reference, 'SCOR' an ISO 11649 creditor reference, and 'NON' none. |
| `items[].referenceNumber` | string | no | A structured payment reference for payments to this account, interpreted per referenceType. |
| `items[].bankAccountCode` | string | no | The bank identifier, the SWIFT/BIC code or the US routing number. |
| `items[].bankAccountHolderName` | string | no | The name the account is held in. This is personal data. |
| `items[].paymentAllowed` | boolean | yes | Whether payments may be made from this account. |
| `items[].receivableAccount` | boolean | no | Whether this account may be used to receive money. |
| `items[].payableAccount` | boolean | no | Whether this account may be used to pay money out. |
| `items[].isReady` | boolean | no | Whether the account is fully set up and usable. |
| `items[].reconciliationStartDate` | date | yes | The date from which this account is reconciled. Format YYYY-MM-DD. Transactions before it are not reconciled. |
| `items[].transactionsImportDate` | date | no | The date from which transactions are imported for this account. Format YYYY-MM-DD. |
| `items[].accountId` | string | no | The chart-of-accounts account this bank account is linked to. See id on GET accounting/accounts/:id. |
| `items[].accountName` | string | no | The name of the linked chart-of-accounts account. |
| `items[].accountNumber` | string | no | The number of the linked chart-of-accounts account. This is a general-ledger account number, not the bank account number, which is reference. |
| `items[].bankName` | string | no | The name of the bank this account is held at. |
| `items[].financialInstitutionId` | string | no | The financial institution this account is held at. There is no endpoint for it. |
| `items[].entityId` | string | no | The legal entity that owns this account. See id on GET base/entities. |
| `items[].entityName` | string | no | The name of the legal entity that owns this account. |
| `items[].lastModifiedDate` | date-time | yes | The date and time the bank account last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `pagination` | object | yes | The pagination cursor for this page. |
| `pagination.nextCursor` | string | no | The cursor for the next page. Pass it as page.cursor. Absent on the last page. |
| `pagination.hasMore` | boolean | yes | True when more matches remain beyond this page. |

```json
{
  "data": {
    "items": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "externalAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "externalAccountName": "<externalAccountName>",
        "externalDescription": "<externalDescription>",
        "type": "<type>",
        "currency": "<currency>",
        "balance": "19.99",
        "mask": "<mask>",
        "reference": "<reference>",
        "referenceType": "<referenceType>",
        "referenceNumber": "<referenceNumber>",
        "bankAccountCode": "<bankAccountCode>",
        "bankAccountHolderName": "<bankAccountHolderName>",
        "paymentAllowed": true,
        "receivableAccount": true,
        "payableAccount": true,
        "isReady": true,
        "reconciliationStartDate": "2026-01-15",
        "transactionsImportDate": "2026-01-15",
        "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "accountName": "<accountName>",
        "accountNumber": "<accountNumber>",
        "bankName": "<bankName>",
        "financialInstitutionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "entityName": "<entityName>",
        "lastModifiedDate": "2026-01-15T09:30:00.000Z"
      }
    ],
    "pagination": {
      "nextCursor": "<nextCursor>",
      "hasMore": true
    }
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Statuses

- `400` — Invalid request or business failure
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
