[role="xpack"]
[[list-connector-api]]
=== List connectors API
++++
<titleabbrev>List connectors</titleabbrev>
++++

preview::[]

Returns information about all created connectors.


[[list-connector-api-request]]
==== {api-request-title}

`GET _connector`

[[list-connector-api-prereq]]
==== {api-prereq-title}

* To sync data using self-managed connectors, you need to deploy the {enterprise-search-ref}/build-connector.html[Elastic connector service] on your own infrastructure. This service runs automatically on Elastic Cloud for native connectors.

[[list-connector-api-path-params]]
==== {api-path-parms-title}

`size`::
(Optional, integer) Maximum number of results to retrieve. Defaults to `100`.

`from`::
(Optional, integer) The offset from the first result to fetch. Defaults to `0`.

`index_name`::
(Optional, string) A comma-separated list of index names associated with connectors, used to filter search results.

`connector_name`::
(Optional, string) A comma-separated list of connector names, used to filter search results.

`service_type`::
(Optional, string) A comma-separated list of connector service types, used to filter search results.

[[list-connector-api-example]]
==== {api-examples-title}

The following example lists all connectors:

////
[source,console]
--------------------------------------------------
PUT _connector/connector-1
{
  "index_name": "search-google-drive",
  "name": "Google Drive Connector",
  "service_type": "google_drive"
}

PUT _connector/connector-2
{
  "index_name": "search-sharepoint-online",
  "name": "Sharepoint Online Connector",
  "service_type": "sharepoint_online"
}

--------------------------------------------------
// TESTSETUP

[source,console]
--------------------------------------------------
DELETE _connector/connector-1

DELETE _connector/connector-2
--------------------------------------------------
// TEARDOWN
////

[source,console]
----
GET _connector
----

The following example lists the first two connectors:

[source,console]
----
GET _connector?from=0&size=2
----

An example to list a connector associated with the `search-google-drive` Elasticsearch index:

[source,console]
----
GET _connector?index_name=search-google-drive
----


An example to list all connectors with `sharepoint_online` service type:

[source,console]
----
GET _connector?service_type=sharepoint_online
----

An example to list all connectors with `sharepoint_online` or `google_drive` service type:

[source,console]
----
GET _connector?service_type=sharepoint_online,google_drive
----
