Elastic Stack (ELK Stack) Indices API
The indices API from Elastic Stack (ELK Stack) — 63 operation(s) for indices.
The indices API from Elastic Stack (ELK Stack) — 63 operation(s) for indices.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/elk-stack-indices-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Elasticsearch Request & Response Specification Indices API
license:
name: Apache 2.0
url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE
version: ''
tags:
- name: indices
paths:
/_component_template/{name}:
get:
tags:
- indices
summary: Get component templates
description: 'Get information about component templates.
## Required authorization
* Cluster privileges: `manage_index_templates`
'
operationId: cluster-get-component-template-1
parameters:
- $ref: '#/components/parameters/cluster.get_component_template-name'
- $ref: '#/components/parameters/cluster.get_component_template-flat_settings'
- $ref: '#/components/parameters/cluster.get_component_template-settings_filter'
- $ref: '#/components/parameters/cluster.get_component_template-include_defaults'
- $ref: '#/components/parameters/cluster.get_component_template-local'
- $ref: '#/components/parameters/cluster.get_component_template-master_timeout'
responses:
'200':
$ref: '#/components/responses/cluster.get_component_template-200'
x-state: Generally available; Added in 7.8.0
x-metaTags:
- content: Elasticsearch
name: product_name
put:
tags:
- indices
summary: Create or update a component template
description: 'Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.
Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
**Applying component templates**
You cannot directly apply a component template to a data stream or index.
To be applied, a component template must be included in an index template''s `composed_of` list.
## Required authorization
* Cluster privileges: `manage_index_templates`
'
operationId: cluster-put-component-template
parameters:
- $ref: '#/components/parameters/cluster.put_component_template-name'
- $ref: '#/components/parameters/cluster.put_component_template-create'
- $ref: '#/components/parameters/cluster.put_component_template-cause'
- $ref: '#/components/parameters/cluster.put_component_template-master_timeout'
requestBody:
$ref: '#/components/requestBodies/cluster.put_component_template'
responses:
'200':
$ref: '#/components/responses/cluster.put_component_template-200'
x-state: Generally available; Added in 7.8.0
x-metaTags:
- content: Elasticsearch
name: product_name
post:
tags:
- indices
summary: Create or update a component template
description: 'Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.
Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
**Applying component templates**
You cannot directly apply a component template to a data stream or index.
To be applied, a component template must be included in an index template''s `composed_of` list.
## Required authorization
* Cluster privileges: `manage_index_templates`
'
operationId: cluster-put-component-template-1
parameters:
- $ref: '#/components/parameters/cluster.put_component_template-name'
- $ref: '#/components/parameters/cluster.put_component_template-create'
- $ref: '#/components/parameters/cluster.put_component_template-cause'
- $ref: '#/components/parameters/cluster.put_component_template-master_timeout'
requestBody:
$ref: '#/components/requestBodies/cluster.put_component_template'
responses:
'200':
$ref: '#/components/responses/cluster.put_component_template-200'
x-state: Generally available; Added in 7.8.0
x-metaTags:
- content: Elasticsearch
name: product_name
delete:
tags:
- indices
summary: Delete component templates
description: 'Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
## Required authorization
* Cluster privileges: `manage_index_templates`
'
operationId: cluster-delete-component-template
parameters:
- in: path
name: name
description: Comma-separated list or wildcard expression of component template names used to limit the request.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Names'
style: simple
- in: query
name: master_timeout
description: 'Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: timeout
description: 'Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/_types.AcknowledgedResponseBase'
x-state: Generally available; Added in 7.8.0
x-metaTags:
- content: Elasticsearch
name: product_name
head:
tags:
- indices
summary: Check component templates
description: Returns information about whether a particular component template exists.
operationId: cluster-exists-component-template
parameters:
- in: path
name: name
description: 'Comma-separated list of component template names used to limit the request.
Wildcard (*) expressions are supported.'
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Names'
style: simple
- in: query
name: master_timeout
description: 'Period to wait for a connection to the master node. If no response is
received before the timeout expires, the request fails and returns an
error.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: local
description: 'If true, the request retrieves information from the local node only.
Defaults to false, which means information is retrieved from the master node.'
deprecated: true
schema:
default: false
type: boolean
style: form
responses:
'200':
description: ''
content:
application/json: {}
x-state: Generally available; Added in 7.8.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_component_template:
get:
tags:
- indices
summary: Get component templates
description: 'Get information about component templates.
## Required authorization
* Cluster privileges: `manage_index_templates`
'
operationId: cluster-get-component-template
parameters:
- $ref: '#/components/parameters/cluster.get_component_template-flat_settings'
- $ref: '#/components/parameters/cluster.get_component_template-settings_filter'
- $ref: '#/components/parameters/cluster.get_component_template-include_defaults'
- $ref: '#/components/parameters/cluster.get_component_template-local'
- $ref: '#/components/parameters/cluster.get_component_template-master_timeout'
responses:
'200':
$ref: '#/components/responses/cluster.get_component_template-200'
x-state: Generally available; Added in 7.8.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_dangling/{index_uuid}:
post:
tags:
- indices
summary: Import a dangling index
description: 'If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.
## Required authorization
* Cluster privileges: `manage`
'
operationId: dangling-indices-import-dangling-index
parameters:
- in: path
name: index_uuid
description: The UUID of the index to import. Use the get dangling indices API to locate the UUID.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Uuid'
style: simple
- in: query
name: accept_data_loss
description: 'This parameter must be set to true to import a dangling index.
Because Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster.'
deprecated: false
schema:
default: false
type: boolean
style: form
- in: query
name: master_timeout
description: The period to wait for a connection to the master node.
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: timeout
description: The period to wait for a response.
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/_types.AcknowledgedResponseBase'
examples:
ImportDanglingIndexResponseExample1:
description: 'A successful response from `POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true`.
'
value: "{\n \"acknowledged\": true\n}"
x-state: Generally available; Added in 7.9.0
x-metaTags:
- content: Elasticsearch
name: product_name
delete:
tags:
- indices
summary: Delete a dangling index
description: 'If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.
## Required authorization
* Cluster privileges: `manage`
'
operationId: dangling-indices-delete-dangling-index
parameters:
- in: path
name: index_uuid
description: The UUID of the index to delete. Use the get dangling indices API to find the UUID.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Uuid'
style: simple
- in: query
name: accept_data_loss
description: This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index.
deprecated: false
schema:
default: false
type: boolean
style: form
- in: query
name: master_timeout
description: The period to wait for a connection to the master node.
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: timeout
description: The period to wait for a response.
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/_types.AcknowledgedResponseBase'
x-state: Generally available; Added in 7.9.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_dangling:
get:
tags:
- indices
summary: Get the dangling indices
description: 'If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.
Use this API to list dangling indices, which you can then import or delete.
## Required authorization
* Cluster privileges: `manage`
'
operationId: dangling-indices-list-dangling-indices
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
dangling_indices:
type: array
items:
$ref: '#/components/schemas/dangling_indices.list_dangling_indices.DanglingIndex'
required:
- dangling_indices
examples:
ListDanglingIndicesResponseExample1:
value: "{\n \"dangling_indices\": [\n {\n \"index_name\": \"my-index-000001\",\n \"index_uuid\": \"zmM4e0JtBkeUjiHD-MihPQ\",\n \"creation_date_millis\": 1589414451372,\n \"node_ids\": [\n \"pL47UN3dAb2d5RCWP6lQ3e\"\n ]\n }\n ]\n}"
x-state: Generally available; Added in 7.9.0
x-metaTags:
- content: Elasticsearch
name: product_name
/{index}/_block/{block}:
put:
tags:
- indices
summary: Add an index block
description: 'Add an index block to an index.
Index blocks limit the operations allowed on an index by blocking specific operation types.'
operationId: indices-add-block
parameters:
- in: path
name: index
description: 'A comma-separated list or wildcard expression of index names used to limit the request.
By default, you must explicitly name the indices you are adding blocks to.
To allow the adding of blocks to indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.
You can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API.'
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Indices'
style: simple
- in: path
name: block
description: The block type to add to the index.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/indices._types.IndicesBlockOptions'
style: simple
- in: query
name: allow_no_indices
description: 'A setting that does two separate checks on the index expression.
If `false`, the request returns an error (1) if any wildcard expression
(including `_all` and `*`) resolves to zero matching indices or (2) if the
complete set of resolved indices, aliases or data streams is empty after all
expressions are evaluated. If `true`, index expressions that resolve to no
indices are allowed and the request returns an empty result.'
deprecated: false
schema:
default: true
type: boolean
style: form
- in: query
name: expand_wildcards
description: 'The type of index that wildcard patterns can match.
If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
It supports comma-separated values, such as `open,hidden`.'
deprecated: false
schema:
default: open
allOf:
- $ref: '#/components/schemas/_types.ExpandWildcards'
style: form
- in: query
name: ignore_unavailable
description: 'If `false`, the request returns an error if it targets a concrete (non-wildcarded)
index, alias, or data stream that is missing, closed, or otherwise unavailable.
If `true`, unavailable concrete targets are silently ignored.'
deprecated: false
schema:
default: false
type: boolean
style: form
- in: query
name: master_timeout
description: 'The period to wait for the master node.
If the master node is not available before the timeout expires, the request fails and returns an error.
It can also be set to `-1` to indicate that the request should never timeout.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: timeout
description: 'The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.
If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.
It can also be set to `-1` to indicate that the request should never timeout.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
shards_acknowledged:
type: boolean
indices:
type: array
items:
$ref: '#/components/schemas/indices.add_block.AddIndicesBlockStatus'
required:
- acknowledged
- shards_acknowledged
- indices
examples:
IndicesAddBlockResponseExample1:
description: A successful response from `PUT /my-index-000001/_block/write`, which adds an index block to an index.'
value: "{\n \"acknowledged\" : true,\n \"shards_acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"blocked\" : true\n } ]\n}"
x-state: Generally available; Added in 7.9.0
x-metaTags:
- content: Elasticsearch
name: product_name
delete:
tags:
- indices
summary: Remove an index block
description: 'Remove an index block from an index.
Index blocks limit the operations allowed on an index by blocking specific operation types.
## Required authorization
* Index privileges: `manage`
'
operationId: indices-remove-block
parameters:
- in: path
name: index
description: 'A comma-separated list or wildcard expression of index names used to limit the request.
By default, you must explicitly name the indices you are removing blocks from.
To allow the removal of blocks from indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.
You can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API.'
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Indices'
style: simple
- in: path
name: block
description: The block type to remove from the index.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/indices._types.IndicesBlockOptions'
style: simple
- in: query
name: allow_no_indices
description: 'A setting that does two separate checks on the index expression.
If `false`, the request returns an error (1) if any wildcard expression
(including `_all` and `*`) resolves to zero matching indices or (2) if the
complete set of resolved indices, aliases or data streams is empty after all
expressions are evaluated. If `true`, index expressions that resolve to no
indices are allowed and the request returns an empty result.'
deprecated: false
schema:
default: true
type: boolean
style: form
- in: query
name: expand_wildcards
description: 'The type of index that wildcard patterns can match.
If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
It supports comma-separated values, such as `open,hidden`.'
deprecated: false
schema:
default: open
allOf:
- $ref: '#/components/schemas/_types.ExpandWildcards'
style: form
- in: query
name: ignore_unavailable
description: 'If `false`, the request returns an error if it targets a concrete (non-wildcarded)
index, alias, or data stream that is missing, closed, or otherwise unavailable.
If `true`, unavailable concrete targets are silently ignored.'
deprecated: false
schema:
default: false
type: boolean
style: form
- in: query
name: master_timeout
description: 'The period to wait for the master node.
If the master node is not available before the timeout expires, the request fails and returns an error.
It can also be set to `-1` to indicate that the request should never timeout.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: timeout
description: 'The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.
If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.
It can also be set to `-1` to indicate that the request should never timeout.'
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
indices:
type: array
items:
$ref: '#/components/schemas/indices.remove_block.RemoveIndicesBlockStatus'
required:
- acknowledged
- indices
examples:
IndicesRemoveBlockResponseExample1:
description: A successful response from `DELETE /my-index-000001/_block/write`, which removes an index block from an index.'
value: "{\n \"acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"unblocked\" : true\n } ]\n}"
x-state: Generally available; Added in 9.1.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_analyze:
get:
tags:
- indices
summary: Get tokens from text analysis
description: 'The analyze API performs analysis on a text string and returns the resulting tokens.
Generating excessive amount of tokens may cause a node to run out of memory.
The `index.analyze.max_token_count` setting enables you to limit the number of tokens that can be produced.
If more than this limit of tokens gets generated, an error occurs.
The `_analyze` endpoint without a specified index will always use `10000` as its limit.
## Required authorization
* Index privileges: `index`
'
externalDocs:
description: Learn more about text analysis
url: https://www.elastic.co/docs/manage-data/data-store/text-analysis
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-analyze.html
operationId: indices-analyze
parameters:
- $ref: '#/components/parameters/indices.analyze-index_'
requestBody:
$ref: '#/components/requestBodies/indices.analyze'
responses:
'200':
$ref: '#/components/responses/indices.analyze-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
post:
tags:
- indices
summary: Get tokens from text analysis
description: 'The analyze API performs analysis on a text string and returns the resulting tokens.
Generating excessive amount of tokens may cause a node to run out of memory.
The `index.analyze.max_token_count` setting enables you to limit the number of tokens that can be produced.
If more than this limit of tokens gets generated, an error occurs.
The `_analyze` endpoint without a specified index will always use `10000` as its limit.
## Required authorization
* Index privileges: `index`
'
externalDocs:
description: Learn more about text analysis
url: https://www.elastic.co/docs/manage-data/data-store/text-analysis
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-analyze.html
operationId: indices-analyze-1
parameters:
- $ref: '#/components/parameters/indices.analyze-index_'
requestBody:
$ref: '#/components/requestBodies/indices.analyze'
responses:
'200':
$ref: '#/components/responses/indices.analyze-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
/{index}/_analyze:
get:
tags:
- indices
summary: Get tokens from text analysis
description: 'The analyze API performs analysis on a text string and returns the resulting tokens.
Generating excessive amount of tokens may cause a node to run out of memory.
The `index.analyze.max_token_count` setting enables you to limit the number of tokens that can be produced.
If more than this limit of tokens gets generated, an error occurs.
The `_analyze` endpoint without a specified index will always use `10000` as its limit.
## Required authorization
* Index privileges: `index`
'
externalDocs:
description: Learn more about text analysis
url: https://www.elastic.co/docs/manage-data/data-store/text-analysis
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-analyze.html
operationId: indices-analyze-2
parameters:
- $ref: '#/components/parameters/indices.analyze-index'
- $ref: '#/components/parameters/indices.analyze-index_'
requestBody:
$ref: '#/components/requestBodies/indices.analyze'
responses:
'200':
$ref: '#/components/responses/indices.analyze-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
post:
tags:
- indices
summary: Get tokens from text analysis
description: 'The analyze API performs analysis on a text string and returns the resulting tokens.
Generating excessive amount of tokens may cause a node to run out of memory.
The `index.analyze.max_token_count` setting enables you to limit the number of tokens that can be produced.
If more than this limit of tokens gets generated, an error occurs.
The `_analyze` endpoint without a specified index will always use `10000` as its limit.
## Required authorization
* Index privileges: `index`
'
externalDocs:
description: Learn more about text analysis
url: https://www.elastic.co/docs/manage-data/data-store/text-analysis
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-analyze.html
operationId: indices-analyze-3
parameters:
- $ref: '#/components/parameters/indices.analyze-index'
- $ref: '#/components/parameters/indices.analyze-index_'
requestBody:
$ref: '#/components/requestBodies/indices.analyze'
responses:
'200':
$ref: '#/components/responses/indices.analyze-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
/_cache/clear:
post:
tags:
- indices
summary: Clear the cache
description: 'Clear the cache of one or more indices.
For data streams, the API clears the caches of the stream''s backing indices.
By default, the clear cache API clears all caches.
To clear only specific caches, use the `fielddata`, `query`, or `request` parameters.
To clear the cache only of specific fields, use the `fields` parameter.
## Required authorization
* Index privileges: `manage`
'
operationId: indices-clear-cache
parameters:
- $ref: '#/components/parameters/indices.clear_cache-index_'
- $ref: '#/components/parameters/indices.clear_cache-allow_no_indices'
- $ref: '#/components/parameters/indices.clear_cache-expand_wildcards'
- $ref: '#/components/parameters/indices.clear_cache-fielddata'
- $ref: '#/components/parameters/indices.clear_cache-fields'
- $ref: '#/components/parameters/indices.clear_cache-ignore_unavailable'
- $ref: '#/components/parameters/indices.clear_cache-query'
- $ref: '#/components/parameters/indices.clear_cache-request'
responses:
'200':
$ref: '#/components/res
# --- truncated at 32 KB (1004 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elk-stack/refs/heads/main/openapi/elk-stack-indices-api-openapi.yml