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 the enabled flag.
  • incremental_sync (Optional, object) Controls whether incremental syncs are enabled with the enabled flag.
  • native_connector_api_keys(Optional, object) Controls whether managed connector API keys are enabled with the enabled flag.
  • sync_rules (Optional, object) Controls sync rules.

    • advanced (Optional, object) Controls whether advanced sync rules are enabled with the enabled flag.
    • basic(Optional, object) Controls whether basic sync rules are enabled with the enabled 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:

  1. resp = client.perform_request(
  2. "PUT",
  3. "/_connector/my-connector/_features",
  4. headers={"Content-Type": "application/json"},
  5. body={
  6. "features": {
  7. "document_level_security": {
  8. "enabled": True
  9. },
  10. "incremental_sync": {
  11. "enabled": True
  12. },
  13. "sync_rules": {
  14. "advanced": {
  15. "enabled": False
  16. },
  17. "basic": {
  18. "enabled": True
  19. }
  20. }
  21. }
  22. },
  23. )
  24. print(resp)
  1. const response = await client.transport.request({
  2. method: "PUT",
  3. path: "/_connector/my-connector/_features",
  4. body: {
  5. features: {
  6. document_level_security: {
  7. enabled: true,
  8. },
  9. incremental_sync: {
  10. enabled: true,
  11. },
  12. sync_rules: {
  13. advanced: {
  14. enabled: false,
  15. },
  16. basic: {
  17. enabled: true,
  18. },
  19. },
  20. },
  21. },
  22. });
  23. console.log(response);
  1. PUT _connector/my-connector/_features
  2. {
  3. "features": {
  4. "document_level_security": {
  5. "enabled": true
  6. },
  7. "incremental_sync": {
  8. "enabled": true
  9. },
  10. "sync_rules": {
  11. "advanced": {
  12. "enabled": false
  13. },
  14. "basic": {
  15. "enabled": true
  16. }
  17. }
  18. }
  19. }
  1. {
  2. "result": "updated"
  3. }

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:

  1. resp = client.perform_request(
  2. "PUT",
  3. "/_connector/my-connector/_features",
  4. headers={"Content-Type": "application/json"},
  5. body={
  6. "features": {
  7. "document_level_security": {
  8. "enabled": True
  9. }
  10. }
  11. },
  12. )
  13. print(resp)
  1. const response = await client.transport.request({
  2. method: "PUT",
  3. path: "/_connector/my-connector/_features",
  4. body: {
  5. features: {
  6. document_level_security: {
  7. enabled: true,
  8. },
  9. },
  10. },
  11. });
  12. console.log(response);
  1. PUT _connector/my-connector/_features
  2. {
  3. "features": {
  4. "document_level_security": {
  5. "enabled": true
  6. }
  7. }
  8. }
  1. {
  2. "result": "updated"
  3. }