delete-connector-api.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. [[delete-connector-api]]
  2. === Delete connector API
  3. ++++
  4. <titleabbrev>Delete connector</titleabbrev>
  5. ++++
  6. beta::[]
  7. Removes a connector and associated sync jobs.
  8. This is a destructive action that is not recoverable.
  9. Note: this action doesn't delete any API key, ingest pipeline or data index associated with the connector. These need to be removed manually.
  10. To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
  11. [[delete-connector-api-request]]
  12. ==== {api-request-title}
  13. `DELETE _connector/<connector_id>`
  14. [[delete-connector-api-prereq]]
  15. ==== {api-prereq-title}
  16. * 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.
  17. * The `connector_id` parameter should reference an existing connector.
  18. [[delete-connector-api-path-params]]
  19. ==== {api-path-parms-title}
  20. `<connector_id>`::
  21. (Required, string)
  22. `delete_sync_jobs`::
  23. (Optional, boolean) A flag indicating if associated sync jobs should be also removed. Defaults to `false`.
  24. [[delete-connector-api-response-codes]]
  25. ==== {api-response-codes-title}
  26. `400`::
  27. The `connector_id` was not provided.
  28. `404` (Missing resources)::
  29. No connector matching `connector_id` could be found.
  30. [[delete-connector-api-example]]
  31. ==== {api-examples-title}
  32. The following example deletes the connector with ID `my-connector`:
  33. ////
  34. [source, console]
  35. --------------------------------------------------
  36. PUT _connector/my-connector
  37. {
  38. "name": "My Connector",
  39. "service_type": "google_drive"
  40. }
  41. PUT _connector/another-connector
  42. {
  43. "name": "My Connector",
  44. "service_type": "google_drive"
  45. }
  46. --------------------------------------------------
  47. // TESTSETUP
  48. ////
  49. [source,console]
  50. ----
  51. DELETE _connector/another-connector?delete_sync_jobs=true
  52. ----
  53. [source,console-result]
  54. ----
  55. {
  56. "acknowledged": true
  57. }
  58. ----
  59. The following example deletes the connector with ID `another-connector` and its associated sync jobs.