[[reference-connector]]
== client.connector

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////
++++
<style>
.lang-ts a.xref {
  text-decoration: underline !important;
}
</style>
++++


[discrete]
[[client.connector.checkIn]]
== `client.connector.checkIn()`

Check in a connector. Update the `last_seen` field in the connector and set it to the current timestamp.

{ref}/check-in-connector-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorCheckInRequest, options?: TransportRequestOptions) => Promise<ConnectorCheckInResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorCheckInRequest extends <<RequestBase>> {
  connector_id: <<Id>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorCheckInResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.delete]]
== `client.connector.delete()`

Delete a connector. Removes a connector and associated sync jobs. This is a destructive action that is not recoverable. NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector. These need to be removed manually.

{ref}/delete-connector-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorDeleteRequest, options?: TransportRequestOptions) => Promise<ConnectorDeleteResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorDeleteRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  delete_sync_jobs?: boolean
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
type ConnectorDeleteResponse = <<AcknowledgedResponseBase>>

----


[discrete]
[[client.connector.get]]
== `client.connector.get()`

Get a connector. Get the details about a connector.

{ref}/get-connector-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorGetRequest, options?: TransportRequestOptions) => Promise<ConnectorGetResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorGetRequest extends <<RequestBase>> {
  connector_id: <<Id>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
type ConnectorGetResponse = <<ConnectorConnector>>

----


[discrete]
[[client.connector.list]]
== `client.connector.list()`

Get all connectors. Get information about all connectors.

{ref}/list-connector-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorListRequest, options?: TransportRequestOptions) => Promise<ConnectorListResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorListRequest extends <<RequestBase>> {
  from?: <<integer>>
  size?: <<integer>>
  index_name?: <<Indices>>
  connector_name?: <<Names>>
  service_type?: <<Names>>
  query?: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorListResponse {
  count: <<long>>
  results: <<ConnectorConnector>>[]
}

----


[discrete]
[[client.connector.post]]
== `client.connector.post()`

Create a connector. Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure. Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud. Self-managed connectors (Connector clients) are self-managed on your infrastructure.

{ref}/create-connector-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorPostRequest, options?: TransportRequestOptions) => Promise<ConnectorPostResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorPostRequest extends <<RequestBase>> {
  description?: string
  index_name?: <<IndexName>>
  is_native?: boolean
  language?: string
  name?: string
  service_type?: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorPostResponse {
  result: <<Result>>
  id: <<Id>>
}

----


[discrete]
[[client.connector.put]]
== `client.connector.put()`

Create or update a connector.

{ref}/create-connector-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorPutRequest, options?: TransportRequestOptions) => Promise<ConnectorPutResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorPutRequest extends <<RequestBase>> {
  connector_id?: <<Id>>
  description?: string
  index_name?: <<IndexName>>
  is_native?: boolean
  language?: string
  name?: string
  service_type?: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorPutResponse {
  result: <<Result>>
  id: <<Id>>
}

----


[discrete]
[[client.connector.syncJobCancel]]
== `client.connector.syncJobCancel()`

Cancel a connector sync job. Cancel a connector sync job, which sets the status to cancelling and updates `cancellation_requested_at` to the current time. The connector service is then responsible for setting the status of connector sync jobs to cancelled.

{ref}/cancel-connector-sync-job-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobCancelRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobCancelResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorSyncJobCancelRequest extends <<RequestBase>> {
  connector_sync_job_id: <<Id>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorSyncJobCancelResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.syncJobCheckIn]]
== `client.connector.syncJobCheckIn()`

Checks in a connector sync job (refreshes 'last_seen').

{ref}/check-in-connector-sync-job-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobCheckInRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobCheckInResponse>
----

[discrete]
[[client.connector.syncJobClaim]]
== `client.connector.syncJobClaim()`

Claims a connector sync job.
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobClaimRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobClaimResponse>
----

[discrete]
[[client.connector.syncJobDelete]]
== `client.connector.syncJobDelete()`

Delete a connector sync job. Remove a connector sync job and its associated data. This is a destructive action that is not recoverable.

{ref}/delete-connector-sync-job-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobDeleteResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorSyncJobDeleteRequest extends <<RequestBase>> {
  connector_sync_job_id: <<Id>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
type ConnectorSyncJobDeleteResponse = <<AcknowledgedResponseBase>>

----


[discrete]
[[client.connector.syncJobError]]
== `client.connector.syncJobError()`

Sets an error for a connector sync job.

{ref}/set-connector-sync-job-error-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobErrorRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobErrorResponse>
----

[discrete]
[[client.connector.syncJobGet]]
== `client.connector.syncJobGet()`

Get a connector sync job.

{ref}/get-connector-sync-job-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobGetRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobGetResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorSyncJobGetRequest extends <<RequestBase>> {
  connector_sync_job_id: <<Id>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
type ConnectorSyncJobGetResponse = <<ConnectorConnectorSyncJob>>

----


[discrete]
[[client.connector.syncJobList]]
== `client.connector.syncJobList()`

Get all connector sync jobs. Get information about all stored connector sync jobs listed by their creation date in ascending order.

{ref}/list-connector-sync-jobs-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobListRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobListResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorSyncJobListRequest extends <<RequestBase>> {
  from?: <<integer>>
  size?: <<integer>>
  status?: <<ConnectorSyncStatus>>
  connector_id?: <<Id>>
  job_type?: <<ConnectorSyncJobType>> | <<ConnectorSyncJobType>>[]
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorSyncJobListResponse {
  count: <<long>>
  results: <<ConnectorConnectorSyncJob>>[]
}

----


[discrete]
[[client.connector.syncJobPost]]
== `client.connector.syncJobPost()`

Create a connector sync job. Create a connector sync job document in the internal index and initialize its counters and timestamps with default values.

{ref}/create-connector-sync-job-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobPostRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobPostResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorSyncJobPostRequest extends <<RequestBase>> {
  id: <<Id>>
  job_type?: <<ConnectorSyncJobType>>
  trigger_method?: <<ConnectorSyncJobTriggerMethod>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorSyncJobPostResponse {
  id: <<Id>>
}

----


[discrete]
[[client.connector.syncJobUpdateStats]]
== `client.connector.syncJobUpdateStats()`

Updates the stats fields in the connector sync job document.

{ref}/set-connector-sync-job-stats-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorSyncJobUpdateStatsRequest, options?: TransportRequestOptions) => Promise<ConnectorSyncJobUpdateStatsResponse>
----

[discrete]
[[client.connector.updateActiveFiltering]]
== `client.connector.updateActiveFiltering()`

Activate the connector draft filter. Activates the valid draft filtering for a connector.

{ref}/update-connector-filtering-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateActiveFilteringResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateActiveFilteringRequest extends <<RequestBase>> {
  connector_id: <<Id>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateActiveFilteringResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateApiKeyId]]
== `client.connector.updateApiKeyId()`

Update the connector API key ID. Update the `api_key_id` and `api_key_secret_id` fields of a connector. You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. The connector secret ID is required only for Elastic managed (native) connectors. Self-managed connectors (connector clients) do not use this field.

{ref}/update-connector-api-key-id-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateApiKeyIdResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateApiKeyIdRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  api_key_id?: string
  api_key_secret_id?: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateApiKeyIdResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateConfiguration]]
== `client.connector.updateConfiguration()`

Update the connector configuration. Update the configuration field in the connector document.

{ref}/update-connector-configuration-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateConfigurationResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateConfigurationRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  configuration?: <<ConnectorConnectorConfiguration>>
  values?: Record<string, any>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateConfigurationResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateError]]
== `client.connector.updateError()`

Update the connector error field. Set the error field for the connector. If the error provided in the request body is non-null, the connector’s status is updated to error. Otherwise, if the error is reset to null, the connector status is updated to connected.

{ref}/update-connector-error-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateErrorRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateErrorResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateErrorRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  error: <<SpecUtilsWithNullValue>><string>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateErrorResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateFeatures]]
== `client.connector.updateFeatures()`

Updates the connector features in the connector document.

{ref}/update-connector-features-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateFeaturesRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateFeaturesResponse>
----

[discrete]
[[client.connector.updateFiltering]]
== `client.connector.updateFiltering()`

Update the connector filtering. Update the draft filtering configuration of a connector and marks the draft validation state as edited. The filtering draft is activated once validated by the running Elastic connector service. The filtering property is used to configure sync rules (both basic and advanced) for a connector.

{ref}/update-connector-filtering-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateFilteringRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateFilteringResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateFilteringRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  filtering?: <<ConnectorFilteringConfig>>[]
  rules?: <<ConnectorFilteringRule>>[]
  advanced_snippet?: <<ConnectorFilteringAdvancedSnippet>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateFilteringResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateFilteringValidation]]
== `client.connector.updateFilteringValidation()`

Update the connector draft filtering validation. Update the draft filtering validation info for a connector.
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateFilteringValidationResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateFilteringValidationRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  validation: <<ConnectorFilteringRulesValidation>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateFilteringValidationResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateIndexName]]
== `client.connector.updateIndexName()`

Update the connector index name. Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.

{ref}/update-connector-index-name-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateIndexNameResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateIndexNameRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  index_name: <<SpecUtilsWithNullValue>><<<IndexName>>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateIndexNameResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateName]]
== `client.connector.updateName()`

Update the connector name and description.

{ref}/update-connector-name-description-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateNameRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateNameResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateNameRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  name?: string
  description?: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateNameResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateNative]]
== `client.connector.updateNative()`

Update the connector is_native flag.
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateNativeRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateNativeResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateNativeRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  is_native: boolean
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateNativeResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updatePipeline]]
== `client.connector.updatePipeline()`

Update the connector pipeline. When you create a new connector, the configuration of an ingest pipeline is populated with default settings.

{ref}/update-connector-pipeline-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdatePipelineRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdatePipelineResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdatePipelineRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  pipeline: <<ConnectorIngestPipelineParams>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdatePipelineResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateScheduling]]
== `client.connector.updateScheduling()`

Update the connector scheduling.

{ref}/update-connector-scheduling-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateSchedulingResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateSchedulingRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  scheduling: <<ConnectorSchedulingConfiguration>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateSchedulingResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateServiceType]]
== `client.connector.updateServiceType()`

Update the connector service type.

{ref}/update-connector-service-type-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateServiceTypeResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateServiceTypeRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  service_type: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateServiceTypeResponse {
  result: <<Result>>
}

----


[discrete]
[[client.connector.updateStatus]]
== `client.connector.updateStatus()`

Update the connector status.

{ref}/update-connector-status-api.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: ConnectorUpdateStatusRequest, options?: TransportRequestOptions) => Promise<ConnectorUpdateStatusResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface ConnectorUpdateStatusRequest extends <<RequestBase>> {
  connector_id: <<Id>>
  status: <<ConnectorConnectorStatus>>
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface ConnectorUpdateStatusResponse {
  result: <<Result>>
}

----


