Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access.
To use this API, you must have at least the manage_security cluster privilege.
Users can only update API keys that they created.
To update another user's API key, use the run_as feature to submit a request on behalf of another user.
Important
It's not possible to use an API key as the authentication credential for this API.
To update an API key, the owner user's credentials are required.
It's not possible to update expired API keys, or API keys that have been invalidated by the invalidate API key API.
This API supports updates to an API key's access scope, metadata, and expiration.
The owner user's information, such as the username and realm, is also updated automatically on every call.
Note
This API cannot update REST API keys, which should be updated by either the update API key or bulk update API keys API.
The access to be granted to this API key.
The access is composed of permissions for cross cluster search and cross cluster replication.
At least one of them must be specified.
When specified, the new access assignment fully replaces the previously assigned access.
replicationobject[]
A list of indices permission entries for cross-cluster replication.
namesunionstring | string[]required
A list of indices (or index name patterns) to which the permissions in this entry apply.
allow_restricted_indicesboolean · default: false
This needs to be set to true if the patterns in the names field should cover system indices.
searchobject[]
A list of indices permission entries for cross-cluster search.
field_securityobject
The document fields that the owners of the role have read access to.
A list of indices (or index name patterns) to which the permissions in this entry apply.
queryuniononeOf
A search query that defines the documents the owners of the role have access to. A document within the specified indices must match this query for it to be accessible by the owners of the role.
An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
templateobject
When you create a role, you can specify a query that defines the document level security permissions. You can optionally
use Mustache templates in the role query to insert the username of the current authenticated user into the role.
Like other places in Elasticsearch that support templating or scripting, you can specify inline, stored, or file-based
templates and define custom parameters. You access the details for the current authenticated user through the _user parameter.
An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
idstring
The id for a stored script.
paramsmapstring to object
Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
langunionanyOf · default: painless
Specifies the language the script is written in.
Supported values include:
painless: Painless scripting language, purpose-built for Elasticsearch.
expression: Lucene’s expressions language, compiles a JavaScript expression to bytecode.
mustache: Mustache templated, used for templates.
java: Expert Java API
Values:painlessexpressionmustachejava
optionsmapstring to string
allow_restricted_indicesboolean · default: false
Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices.
expirationuniononeOf
The expiration time for the API key.
By default, API keys never expire. This property can be omitted to leave the value unchanged.
Values:-10
metadataobject
Arbitrary metadata that you want to associate with the API key.
It supports nested data structure.
Within the metadata object, keys beginning with _ are reserved for system usage.
When specified, this information fully replaces metadata previously associated with the API key.
certificate_identitystring
The certificate identity to associate with this API key.
This field is used to restrict the API key to connections authenticated by a specific TLS certificate.
The value should match the certificate's distinguished name (DN) pattern.
When specified, this fully replaces any previously assigned certificate identity.
To clear an existing certificate identity, explicitly set this field to null.
When omitted, the existing certificate identity remains unchanged.