Update connector configuration API

edit

Update connector configuration API

edit

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.

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

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

Request

edit

PUT _connector/<connector_id>/_configuration

Prerequisites

edit
  • 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 native 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 connectors references for details.

Path parameters

edit
<connector_id>
(Required, string)

Request body

edit
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

edit
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

edit

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.

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

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.

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