---
title: "search tokens · RUAL Documentation"
description: "Find existing access tokens by query, without exposing the token itself."
canonical: https://docs.rual.nl/block-types/session%20management/function_sessions_management_search
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# search tokens

This block is part of the [`session management`](https://docs.rual.nl/block-types/session%20management) group and was last modified in core [`v12.0.7`](https://docs.rual.nl/core-versions/120007).

Find existing access tokens by query, without exposing the token itself.

- flow `flow`

- query required `query`

- flow `flow`

- matches `array `

- hits `number`

Searches the built-in auth storage with the given query and outputs the matching session documents on matches and the total match count on hits (include_hits is forced on; default limit 5000). A nil, unwired, or non-query query : or a failed search : outputs an empty matches array and hits=0, with no error signal.

A typical wiring for [search tokens](https://docs.rual.nl/block-types/session%2520management/function_sessions_management_search): [filter](https://docs.rual.nl/block-types/query/query_bool_filter) feeds the `query` pin; the `flow` out pin feeds [foreach](https://docs.rual.nl/block-types/foreach/function_foreach); the `matches` out pin feeds [select fields](https://docs.rual.nl/block-types/array/array_get_by_fields).

[![Studio canvas example for the search tokens block: typical wiring for search tokens.](https://docs.rual.nl/canvas-examples/function_sessions_management_search.png)](https://docs.rual.nl/canvas-examples/function_sessions_management_search.png?v=3)

## Commonly used with

In production blueprints, this block is most often wired together with:

- [filter](https://docs.rual.nl/block-types/query/query_bool_filter): feeds into this block. Build a custom query using higher-level bool query.

- [foreach](https://docs.rual.nl/block-types/foreach/function_foreach): this block feeds into it.

- [create](https://docs.rual.nl/block-types/globals/trigger_custom_function): feeds into this block. Creates a new function that can be executed using the given name.

- [select fields](https://docs.rual.nl/block-types/array/array_get_by_fields): this block feeds into it. Filters all other fields from the objects in this array.

- [branch](https://docs.rual.nl/block-types/flow/branch): this block feeds into it.

- [>=](https://docs.rual.nl/block-types/condition/condition_gte): this block feeds into it. returns true if the number is higher or equal.

## Version history

Introduced in [`v12.0.7`](https://docs.rual.nl/core-versions/120007).

- [Back to `session management`](https://docs.rual.nl/block-types/session%20management): Return to the main group to view all sub-groups

- [Back to `session management`](https://docs.rual.nl/block-types/session%20management?group=session%20management): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
