Update connector features API
Update connector features 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.
Manages the features
of a connector. This endpoint can be used to control the following aspects of a connector:
- document-level security
- incremental syncs
- advanced sync rules
- basic sync rules
Normally, the running connector service automatically manages these features. However, you can use this API to override the default behavior.
To get started with Connector APIs, check out our tutorial.
Request
PUT _connector/<connector_id>/_features
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.
Path parameters
<connector_id>
(Required, string)
Request body
features
(Required, object) An object containing connector features.
document_level_security
(Optional, object) Controls whether document-level security is enabled with theenabled
flag.incremental_sync
(Optional, object) Controls whether incremental syncs are enabled with theenabled
flag.native_connector_api_keys
(Optional, object) Controls whether managed connector API keys are enabled with theenabled
flag.sync_rules
(Optional, object) Controls sync rules.advanced
(Optional, object) Controls whether advanced sync rules are enabled with theenabled
flag.basic
(Optional, object) Controls whether basic sync rules are enabled with theenabled
flag.
Response codes
200
Connector features
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 updates the features
field for the connector with ID my-connector
:
resp = client.perform_request(
"PUT",
"/_connector/my-connector/_features",
headers={"Content-Type": "application/json"},
body={
"features": {
"document_level_security": {
"enabled": True
},
"incremental_sync": {
"enabled": True
},
"sync_rules": {
"advanced": {
"enabled": False
},
"basic": {
"enabled": True
}
}
}
},
)
print(resp)
const response = await client.transport.request({
method: "PUT",
path: "/_connector/my-connector/_features",
body: {
features: {
document_level_security: {
enabled: true,
},
incremental_sync: {
enabled: true,
},
sync_rules: {
advanced: {
enabled: false,
},
basic: {
enabled: true,
},
},
},
},
});
console.log(response);
PUT _connector/my-connector/_features
{
"features": {
"document_level_security": {
"enabled": true
},
"incremental_sync": {
"enabled": true
},
"sync_rules": {
"advanced": {
"enabled": false
},
"basic": {
"enabled": true
}
}
}
}
{
"result": "updated"
}
The endpoint supports partial updates of the features
field. For example, to update only the document_level_security
feature, you can send the following request:
resp = client.perform_request(
"PUT",
"/_connector/my-connector/_features",
headers={"Content-Type": "application/json"},
body={
"features": {
"document_level_security": {
"enabled": True
}
}
},
)
print(resp)
const response = await client.transport.request({
method: "PUT",
path: "/_connector/my-connector/_features",
body: {
features: {
document_level_security: {
enabled: true,
},
},
},
});
console.log(response);
PUT _connector/my-connector/_features
{
"features": {
"document_level_security": {
"enabled": true
}
}
}
{
"result": "updated"
}