Skip to main content
POST
/
{collection}
/
filter
Search via DB
curl --request POST \
  --url http://localhost:5001/{collection}/filter \
  --header 'X-blnk-key: <api-key>'
Use blnk.Search.filter to filter records in a collection.
blnk.Search.filter
const response = await blnk.Search.filter(
  {
    filters: [{ field: 'status', operator: 'eq', value: 'APPLIED' }],
    logical_operator: 'and',
    sort_by: 'created_at',
    sort_order: 'desc',
    include_count: true,
    limit: 20,
    offset: 0,
  },
  'transactions',
);
FieldDescription
filtersArray of filter conditions, each with a field, operator, and a value or values.
logical_operatorCombine filters with and or or. Defaults to and.
sort_byField to sort by. Defaults to created_at.
sort_orderSort direction, asc or desc. Defaults to desc.
include_countReturn total_count in the response. Defaults to false.
limitMaximum records to return. Defaults to 20, max 100.
offsetRecords to skip for pagination. Defaults to 0.
collectionCollection to filter: ledgers, transactions, balances, or identities.

Response shape

200 OK
{
  "data": [
    {
      "transaction_id": "txn_abc123",
      "amount": 15000,
      "currency": "USD",
      "status": "APPLIED",
      "source": "bln_source123",
      "destination": "bln_dest456",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total_count": 150
}
FieldDescription
dataArray of matching records. Shape varies by collection.
total_countTotal matching records. Only present when include_count is true.

How DB filtering works

Supported operators and field reference.

Search via DB

HTTP request and response schema.

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.