2023-12-13 16:27:32 +08:00
[role="xpack"]
[[list-connector-api]]
=== List connectors API
++++
<titleabbrev>List connectors</titleabbrev>
++++
2024-01-12 19:13:34 +08:00
preview::[]
2024-04-24 14:35:40 +08:00
Returns information about all created connectors.
2023-12-13 16:27:32 +08:00
[[list-connector-api-request]]
==== {api-request-title}
`GET _connector`
[[list-connector-api-prereq]]
==== {api-prereq-title}
2024-04-24 14:35:40 +08:00
* 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.
2023-12-13 16:27:32 +08:00
[[list-connector-api-path-params]]
==== {api-path-parms-title}
`size`::
2024-04-24 14:35:40 +08:00
(Optional, integer) Maximum number of results to retrieve. Defaults to `100`.
2023-12-13 16:27:32 +08:00
`from`::
2024-04-24 14:35:40 +08:00
(Optional, integer) The offset from the first result to fetch. Defaults to `0`.
2023-12-13 16:27:32 +08:00
2024-02-14 19:10:59 +08:00
`index_name`::
2024-04-24 14:35:40 +08:00
(Optional, string) A comma-separated list of index names associated with connectors, used to filter search results.
2024-02-14 19:10:59 +08:00
`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.
2023-12-13 16:27:32 +08:00
[[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]
----
2024-04-24 14:35:40 +08:00
GET _connector?from=0&size=2
2023-12-13 16:27:32 +08:00
----
2024-02-14 19:10:59 +08:00
2024-04-24 14:35:40 +08:00
An example to list a connector associated with the `search-google-drive` Elasticsearch index:
2024-02-14 19:10:59 +08:00
[source,console]
----
2024-04-24 14:35:40 +08:00
GET _connector?index_name=search-google-drive
2024-02-14 19:10:59 +08:00
----
An example to list all connectors with `sharepoint_online` service type:
[source,console]
----
2024-04-24 14:35:40 +08:00
GET _connector?service_type=sharepoint_online
2024-02-14 19:10:59 +08:00
----
An example to list all connectors with `sharepoint_online` or `google_drive` service type:
[source,console]
----
2024-04-24 14:35:40 +08:00
GET _connector?service_type=sharepoint_online,google_drive
2024-02-14 19:10:59 +08:00
----