Path parameters

  • idstring Required

    The ID of the cross-cluster API key to update.

application/json

BodyRequired

  • accessobject Required
    Hide access attributes Show access attributes object
    • replicationarray[object]

      A list of indices permission entries for cross-cluster replication.

      Hide replication attributes Show replication attributes object
  • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • metadataobject
    Hide metadata attribute Show metadata attribute object

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • updatedboolean Required

      If true, the API key was updated. If false, the API key didn’t change because no change was detected.

PUT /_security/cross_cluster/api_key/{id}
PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx
{
  "access": {
    "replication": [
      {
        "names": ["archive"]
      }
    ]
  },
  "metadata": {
    "application": "replication"
  }
}
resp = client.security.update_cross_cluster_api_key(
    id="VuaCfGcBCdbkQm-e5aOx",
    access={
        "replication": [
            {
                "names": [
                    "archive"
                ]
            }
        ]
    },
    metadata={
        "application": "replication"
    },
)
const response = await client.security.updateCrossClusterApiKey({
  id: "VuaCfGcBCdbkQm-e5aOx",
  access: {
    replication: [
      {
        names: ["archive"],
      },
    ],
  },
  metadata: {
    application: "replication",
  },
});
response = client.security.update_cross_cluster_api_key(
  id: "VuaCfGcBCdbkQm-e5aOx",
  body: {
    "access": {
      "replication": [
        {
          "names": [
            "archive"
          ]
        }
      ]
    },
    "metadata": {
      "application": "replication"
    }
  }
)
$resp = $client->security()->updateCrossClusterApiKey([
    "id" => "VuaCfGcBCdbkQm-e5aOx",
    "body" => [
        "access" => [
            "replication" => array(
                [
                    "names" => array(
                        "archive",
                    ),
                ],
            ),
        ],
        "metadata" => [
            "application" => "replication",
        ],
    ],
]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"access":{"replication":[{"names":["archive"]}]},"metadata":{"application":"replication"}}' "$ELASTICSEARCH_URL/_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx"
Request example
Run `PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx` to update a cross-cluster API key, assigning it new access scope and metadata.
{
  "access": {
    "replication": [
      {
        "names": ["archive"]
      }
    ]
  },
  "metadata": {
    "application": "replication"
  }
}
Response examples (200)
A successful response from `PUT /_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx` that indicates that the API key was updated.
{
  "updated": true
}