﻿---
title: stack es security clear-api-key-cache cli command
description: Clear the API key cache. Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://docs-v3-preview.elastic.dev/elastic/cli/pull/472/cli/stack/es/security/clear-api-key-cache
---

# stack es security clear-api-key-cache cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack es security clear-api-key-cache --ids <ids> [options]
```

Clear the API key cache.
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--ids string required">
    Comma-separated list of API key IDs to evict from the API key cache. To evict all API keys, use `*`. Does not support other wildcard patterns.
    **Repeatable:** pass `--ids` multiple times to supply more than one value
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--[no-]dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--[no-]json">
    output as JSON
  </definition>
</definitions>