IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Update connector API key ID API
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Update connector API key ID API
editThis 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.
Updates the api_key_id and/or api_key_secret_id field(s) of a connector, specifying:
- The ID of the API key used for authorization
- The ID of the Connector Secret where the API key is stored
The Connector Secret ID is only required for native connectors. Connector clients do not use this field. See the documentation for managing native connector API keys programmatically for more details.
Request
editPUT _connector/<connector_id>/_api_key_id
Prerequisites
edit- To sync data using connectors, it’s essential to have the Elastic connectors service running.
-
The
connector_idparameter should reference an existing connector. -
The
api_key_idparameter should reference an existing API key. -
The
api_key_secret_idparameter should reference an existing Connector Secret containing an encoded API key value.
Path parameters
edit-
<connector_id> - (Required, string)
Request body
edit-
api_key_id - (Optional, string) ID of the API key that the connector will use to authorize access to required indices. Each connector can be associated with at most one API key.
-
api_key_secret_id -
(Optional, string) ID of the Connector Secret that contains the encoded API key. This should be the same API key as
api_key_idreferences. This is only required for native connectors.
Response codes
edit-
200 -
Connector
api_key_idand/orapi_key_secret_idfield(s) successfully updated. -
400 -
The
connector_idwas not provided or the request payload was malformed. -
404(Missing resources) -
No connector matching
connector_idcould be found.
Examples
editThe following example updates the api_key_id and api_key_secret_id field(s) for the connector with ID my-connector:
PUT _connector/my-connector/_api_key_id
{
"api_key_id": "my-api-key-id",
"api_key_secret_id": "my-connector-secret-id"
}
{
"result": "updated"
}