Create or update an alias Added in 1.3.0

POST /_aliases

Adds a data stream or index to an alias.

Query parameters

  • 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.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

application/json

Body Required

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

POST /_aliases
curl \
 -X POST http://api.example.com/_aliases \
 -H "Content-Type: application/json" \
 -d '{"actions":[{"add":{"alias":"string","aliases":"string","filter":{},"index":"string","indices":"string","index_routing":"string","is_hidden":true,"is_write_index":true,"routing":"string","search_routing":"string","must_exist":true},"remove":{"alias":"string","aliases":"string","index":"string","indices":"string","must_exist":true},"remove_index":{"index":"string","indices":"string","must_exist":true}}]}'
Request examples
{
  "actions": [
    {
      "add": {
        "alias": "string",
        "aliases": "string",
        "filter": {},
        "index": "string",
        "indices": "string",
        "index_routing": "string",
        "is_hidden": true,
        "is_write_index": true,
        "routing": "string",
        "search_routing": "string",
        "must_exist": true
      },
      "remove": {
        "alias": "string",
        "aliases": "string",
        "index": "string",
        "indices": "string",
        "must_exist": true
      },
      "remove_index": {
        "index": "string",
        "indices": "string",
        "must_exist": true
      }
    }
  ]
}
Response examples (200)
{
  "acknowledged": true
}