AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 6.7This functionality is generally available and ready for production usage.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
This API invalidates API keys created by the create API key or grant API key APIs.
Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted.
To use this API, you must have at least the manage_security, manage_api_key, or manage_own_api_key cluster privileges.
The manage_security privilege allows deleting any API key, including both REST and cross cluster API keys.
The manage_api_key privilege allows deleting any REST API key, but not cross cluster API keys.
The manage_own_api_key only allows deleting REST API keys that are owned by the user.
In addition, with the manage_own_api_key privilege, an invalidation request must be issued in one of the three formats:
Set the parameter owner=true.
Or, set both username and realm_name to match the user's identity.
Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the ids field.
A list of API key ids.
This parameter cannot be used with any of name, realm_name, or username.
namestring
An API key name.
This parameter cannot be used with any of ids, realm_name or username.
ownerboolean · default: false
Query API keys owned by the currently authenticated user.
The realm_name or username parameters cannot be specified when this parameter is set to true as they are assumed to be the currently authenticated ones.
Note
At least one of ids, name, username, and realm_name must be specified if owner is false.
realm_namestring
The name of an authentication realm.
This parameter cannot be used with either ids or name, or when owner flag is set to true.
usernamestring
The username of a user.
This parameter cannot be used with either ids or name or when owner flag is set to true.