AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 1.3This 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.
Applies one or more actions in a single request:
Add a data stream or index to an alias.
Remove a data stream or index from an alias.
Delete an index in that same request, so the deletion and the alias changes are applied together.
For example, you can replace an index with an alias of the same name.
Note
Every remove_index action in the request runs first, before any add or remove actions, no matter where it sits in the actions array.
Query used to limit documents the alias can access.
indexstring
Data stream or index for the action.
Supports wildcards (*).
Wildcard patterns that match both data streams and indices return an error.
indicesuniononeOf
Data streams or indices for the action.
Supports wildcards (*).
Wildcard patterns that match both data streams and indices return an error.
One of:string[]orstring
index_routingstring
Value used to route indexing operations to a specific shard.
If specified, this overwrites the routing value for indexing operations.
Data stream aliases don’t support this parameter.
is_hiddenboolean · default: false
If true, the alias is hidden.
is_write_indexboolean
If true, sets the write index or data stream for the alias.
routingstring
Value used to route indexing and search operations to a specific shard.
Data stream aliases don’t support this parameter.
search_routingstring
Value used to route search operations to a specific shard.
If specified, this overwrites the routing value for search operations.
Data stream aliases don’t support this parameter.
must_existboolean · default: false
If true, the alias must exist to perform the action.
removeobject
Removes a data stream or index from an alias.
aliasstring
Alias for the action.
Index alias names support date math.
aliasesunionstring | string[]
Aliases for the action.
Index alias names support date math.
indexstring
Data stream or index for the action.
Supports wildcards (*).
indicesuniononeOf
Data streams or indices for the action.
Supports wildcards (*).
One of:string[]orstring
must_existboolean · default: false
If true, the alias must exist to perform the action.
remove_indexobject
Deletes an index.
You cannot use this action on aliases or data streams.
indexstring
Data stream or index for the action.
Supports wildcards (*).
indicesuniononeOf
Data streams or indices for the action.
Supports wildcards (*).
One of:string[]orstring
must_existboolean · default: false
If true, the alias must exist to perform the action.
For a successful response, this value is always true. On failure, an exception is returned instead.
errorsbooleanThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 8.14This 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.
If true, at least one alias action failed.
The request still returns HTTP 200.
action_resultsobject[]The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 8.14This 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.
Results for each action in the request.
Returned only when errors is true.
actionobjectrequired
The action this result describes.
typeenumrequired
The action that was applied.
Values:addremoveremove_index
indicesstring[]required
Resolved data streams or indices for the action.
aliasesstring[]required
Aliases for the action.
statusnumberrequired
HTTP status for this action.
200 when the action succeeds.
errorobject
Cause of the failure.
Returned only when this action fails.
typestringrequired
The type of error
reasonunionstringnullable
A human-readable explanation of the error, in English.
One of:string
stack_tracestring
The server stack trace. Present only if the error_trace=true parameter was sent with the request.