Update connector last sync stats APIedit

This 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 fields related to the last sync of a connector.

This action is used for analytics and monitoring.


PUT _connector/<connector_id>/_last_sync


  • To sync data using connectors, it’s essential to have the Elastic connectors service running.
  • The connector_id parameter should reference an existing connector.

Path parametersedit

(Required, string)

Request bodyedit

(Optional, string) The last error message related to access control sync, if any.
(Optional, datetime) The datetime indicating when the last access control sync was scheduled.
(Optional, ConnectorSyncStatus) The status of the last access control sync.
(Optional, long) The number of documents deleted in the last sync process.
(Optional, datetime) The datetime when the last incremental sync was scheduled.
(Optional, long) The number of documents indexed in the last sync.
(Optional, string) The last error message encountered during a sync process, if any.
(Optional, datetime) The datetime when the last sync was scheduled.
(Optional, ConnectorSyncStatus) The status of the last sync.
(Optional, datetime) The datetime of the last successful synchronization.

The value of ConnectorSyncStatus is one of the following lowercase strings representing different sync states:

  • canceling: The sync process is in the process of being canceled.
  • canceled: The sync process has been canceled.
  • completed: The sync process completed successfully.
  • error: An error occurred during the sync process.
  • in_progress: The sync process is currently underway.
  • pending: The sync is pending and has not yet started.
  • suspended: The sync process has been temporarily suspended.

Response codesedit

Connector last sync stats were successfully updated.
The connector_id was not provided or the request payload was malformed.
404 (Missing resources)
No connector matching connector_id could be found.


The following example updates the last sync stats for the connector with ID my-connector:

response = client.connector.last_sync(
  connector_id: 'my-connector',
  body: {
    last_access_control_sync_error: 'Houston, we have a problem!',
    last_access_control_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
    last_access_control_sync_status: 'pending',
    last_deleted_document_count: 42,
    last_incremental_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
    last_indexed_document_count: 42,
    last_sync_error: 'Houston, we have a problem!',
    last_sync_scheduled_at: '2024-11-09T15:13:08.231Z',
    last_sync_status: 'completed',
    last_synced: '2024-11-09T15:13:08.231Z'
puts response
PUT _connector/my-connector/_last_sync
    "last_access_control_sync_error": "Houston, we have a problem!",
    "last_access_control_sync_scheduled_at": "2023-11-09T15:13:08.231Z",
    "last_access_control_sync_status": "pending",
    "last_deleted_document_count": 42,
    "last_incremental_sync_scheduled_at": "2023-11-09T15:13:08.231Z",
    "last_indexed_document_count": 42,
    "last_sync_error": "Houston, we have a problem!",
    "last_sync_scheduled_at": "2024-11-09T15:13:08.231Z",
    "last_sync_status": "completed",
    "last_synced": "2024-11-09T15:13:08.231Z"
    "result": "updated"