This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Get default index pattern API
editGet default index pattern API
editDeprecated in 8.0.0.
Use the data views API instead.
[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Retrieve a default index pattern ID. Kibana UI uses default index pattern unless user picks a different one.
Request
editGET <kibana host>:<port>/api/index_patterns/default
GET <kibana host>:<port>/s/<space_id>/api/index_patterns/default
Path parameters
edit-
space_id
-
(Optional, string) An identifier for the space. If
space_id
is not provided in the URL, the default space is used.
Response code
edit-
200
- Indicates a successful call.
Example
editRetrieve the default index pattern id:
$ curl -X GET api/index_patterns/default
The API returns an ID of a default index pattern:
{ "index_pattern_id": "..." }
In case there is no default index pattern, the API returns:
{ "index_pattern_id": null }