[[reference-connector-update_api_key_id]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
=== client.connector.updateApiKeyId

Update the connector API key ID. Update the `api_key_id` and `api_key_secret_id` fields of a connector. You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. The connector secret ID is required only for Elastic managed (native) connectors. Self-managed connectors (connector clients) do not use this field.

{ref}/update-connector-api-key-id-api.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(ConnectorUpdateApiKeyIdRequest, options?): Promise<ConnectorUpdateApiKeyIdResponse>
----

[discrete]
===== `ConnectorUpdateApiKeyIdRequest`

[source,ts]
----
interface ConnectorUpdateApiKeyIdRequest extends <<shared-type-request-base, RequestBase>> {
  connector_id: <<shared-type-id, Id>>
  api_key_id?: string
  api_key_secret_id?: string
}
----

[discrete]
===== `ConnectorUpdateApiKeyIdResponse`

[source,ts]
----
interface ConnectorUpdateApiKeyIdResponse {
  result: <<shared-type-result, Result>>
}
----

