Update connector configuration API

Update connector configuration API

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

New API reference

For the most up-to-date API details, refer to Connector APIs.

Updates a connector’s configuration, allowing for config value updates within a registered configuration schema.

To get started with Connector APIs, check out our tutorial.

Request

PUT _connector/<connector_id>/_configuration

Prerequisites

  • To sync data using self-managed connectors, you need to deploy the Elastic connector service. on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.
  • The connector_id parameter should reference an existing connector.
  • To update configuration values, the connector configuration schema must be first registered by a running instance of Elastic connector service.
  • Make sure configuration fields are compatible with the configuration schema for the third-party data source. Refer to the individual connector references for details.

Path parameters

<connector_id>

(Required, string)

Request body

values

(Optional, object) Configuration values for the connector, represented as a mapping of configuration fields to their respective values within a registered schema.

configuration

(Optional, object) The configuration schema definition for the connector. The configuration field is a map where each key represents a specific configuration field name, and the value is a ConnectorConfiguration object. For connector management use values to pass config values. The configuration object is used by the Elastic connector service to register the connector configuration schema.

Response codes

200

Connector configuration was successfully updated.

400

The connector_id was not provided or the request payload was malformed.

404 (Missing resources)

No connector matching connector_id could be found.

Examples

The following example configures a sharepoint_online connector. Find the supported configuration options in the Sharepoint Online connector documentation, or by inspecting the schema in the connector’s configuration field using the Get connector.

  1. resp = client.connector.update_configuration(
  2. connector_id="my-spo-connector",
  3. values={
  4. "tenant_id": "my-tenant-id",
  5. "tenant_name": "my-sharepoint-site",
  6. "client_id": "foo",
  7. "secret_value": "bar",
  8. "site_collections": "*"
  9. },
  10. )
  11. print(resp)
  1. const response = await client.connector.updateConfiguration({
  2. connector_id: "my-spo-connector",
  3. values: {
  4. tenant_id: "my-tenant-id",
  5. tenant_name: "my-sharepoint-site",
  6. client_id: "foo",
  7. secret_value: "bar",
  8. site_collections: "*",
  9. },
  10. });
  11. console.log(response);
  1. PUT _connector/my-spo-connector/_configuration
  2. {
  3. "values": {
  4. "tenant_id": "my-tenant-id",
  5. "tenant_name": "my-sharepoint-site",
  6. "client_id": "foo",
  7. "secret_value": "bar",
  8. "site_collections": "*"
  9. }
  10. }
  1. {
  2. "result": "updated"
  3. }

When you’re first setting up your connector you’ll need to provide all required configuration details to start running syncs. But you can also use this API to only update a subset of fields. Here’s an example that only updates the secret_value field for a sharepoint_online connector. The other configuration values won’t change.

  1. resp = client.connector.update_configuration(
  2. connector_id="my-spo-connector",
  3. values={
  4. "secret_value": "foo-bar"
  5. },
  6. )
  7. print(resp)
  1. const response = await client.connector.updateConfiguration({
  2. connector_id: "my-spo-connector",
  3. values: {
  4. secret_value: "foo-bar",
  5. },
  6. });
  7. console.log(response);
  1. PUT _connector/my-spo-connector/_configuration
  2. {
  3. "values": {
  4. "secret_value": "foo-bar"
  5. }
  6. }
  1. {
  2. "result": "updated"
  3. }