> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON.TOGGLE

> Toggle a boolean value stored at `path`.

## Arguments

<ParamField body="key" type="str" required>
  The key of the json entry.
</ParamField>

<ParamField body="path" type="str" required>
  The path of the boolean. `$` is the root.
</ParamField>

## Response

<ResponseField type="List[boolean]" required>
  The new value of the boolean.
</ResponseField>

<RequestExample>
  ```py Example theme={"system"}
  bool = redis.json.toggle("key", "$.path.to.bool")
  ```
</RequestExample>


## Related topics

- [JSON.TOGGLE](/docs/redis/sdks/ts/commands/json/toggle.md)
- [Redis® API Compatibility: supported commands, modules, and protocols](/docs/redis/overall/compatibility.md)
- [Credential Protection](/docs/redis/features/credential-protection.md)
- [Connecting with Read-Only Access](/docs/redis/troubleshooting/readonly_connection.md)
- [JSON.DEL](/docs/redis/sdks/py/commands/json/del.md)
