Search + K

Command Palette

Search for a command to run...

Sign In

Clear service account token caches

POST /_security/service/{namespace}/{service}/credential/token/{name}/_clear_cache
Copy endpoint

Evict a subset of all entries from the service account token caches. Two separate caches exist for service account tokens: one cache for tokens backed by the service_tokens file, and another for tokens backed by the .security index. This API clears matching entries from both caches.

The cache for service account tokens backed by the .security index is cleared automatically on state changes of the security index. The cache for tokens backed by the service_tokens file is cleared automatically on file changes.

Required authorization

  • Cluster privileges: manage_security

Parameters

path Path Parameters

Name Type
namespace required

The namespace, which is a top-level grouping of service accounts.

type TypesNamespace = string
service required

The name of the service, which must be unique within its namespace.

type TypesService = string
name required

A comma-separated list of token names to evict from the service account token caches. Use a wildcard (*) to evict all tokens that belong to a service account. It does not support other wildcard patterns.

type TypesNames = type TypesName = string | type TypesName = string[]

Responses

200 application/json
{ _nodes: TypesNodeStatistics

Contains statistics about the number of nodes selected by the request.

interface TypesNodeStatistics {
failures?: TypesErrorCause[];
total: number;
successful: number;
failed: number;
}
;cluster_name: TypesName
type TypesName = string
;nodes: { }; }