[[indices-exists]]
=== Exists API
++++
<titleabbrev>Exists</titleabbrev>
++++

Checks if a data stream, index, or alias exists.

[source,console]
----
HEAD my-data-stream
----
// TEST[setup:my_data_stream]
// TEST[teardown:data_stream_cleanup]

[[indices-exists-api-request]]
==== {api-request-title}

`HEAD <target>`

[[indices-exists-api-prereqs]]
==== {api-prereq-title}

* If the {es} {security-features} are enabled, you must have the
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
for the target.

[[indices-exists-api-path-params]]
==== {api-path-parms-title}

`<target>`::
(Optional, string) Comma-separated list of data streams, indices, and aliases.
Supports wildcards (`*`).

[[indices-exists-api-query-params]]
==== {api-query-parms-title}

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
+
Defaults to `true`.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
+
Defaults to `open`.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=include-defaults]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]

[[indices-exists-api-response-codes]]
==== {api-response-codes-title}

`200`::
All targets exist.

`404`::
One or more specified targets do not exist.
