{
  "security.clone_api_key": {
    "documentation": {
      "url": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clone-api-key",
      "description": "Clone an API key. Creates a new API key with the same role descriptors as an existing key, with a new name, id, and optional expiration and metadata."
    },
    "stability": "stable",
    "visibility": "public",
    "headers": {
      "accept": ["application/json"],
      "content_type": ["application/json"]
    },
    "url": {
      "paths": [
        {
          "path": "/_security/api_key/clone",
          "methods": ["POST", "PUT"]
        }
      ]
    },
    "params": {
      "refresh": {
        "type": "enum",
        "options": ["true", "false", "wait_for"],
        "description": "If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. Default is `wait_for` in stateful and `true` in serverless."
      }
    },
    "body": {
      "description": "The clone API key request. Requires `api_key` (encoded credential of the source key) and `name`. Optional: `expiration` (omit = same as source, null = no expiry, value = new expiry), `metadata` (omit = copy from source, provide = overwrite; reserved key `_cloned_from` is added by the server).",
      "required": true
    }
  }
}
