Create connector API
editCreate connector API
editCreates a connector.
Request
editPOST <kibana host>:<port>/api/actions/connector
POST <kibana host>:<port>/s/<space_id>/api/actions/connector
Prerequisites
editYou must have all
privileges for the Actions and Connectors feature in the
Management section of the
Kibana feature privileges.
Path parameters
edit-
space_id
-
(Optional, string) An identifier for the space. If
space_id
is not provided in the URL, the default space is used.
Request body
edit-
config
-
(Required*, object) The configuration for the connector. Configuration properties vary depending on the connector type. For example:
Index connectors
-
executionTimeField
-
(Optional, string) Specifies a field that will contain the time the alert
condition was detected. The default value is
null
. -
index
- (Required, string) The Elasticsearch index to be written to.
-
refresh
-
(Optional, boolean) The refresh policy for the write
request. The default value is
false
.
For more information, refer to Index connector and action.
Jira connectors
-
apiUrl
- (Required, string) The Jira instance URL.
-
projectKey
- (Required, string) The Jira project key.
For more information, refer to Jira connector and action.
This object is not required for server log connectors.
For more configuration properties, refer to Connectors.
-
-
connector_type_id
-
(Required, string) The connector type ID for the connector. For example,
.index
,.jira
, or.server-log
. -
name
- (Required, string) The display name for the connector.
-
secrets
-
(Required*, object) The secrets configuration for the connector. Secrets configuration properties vary depending on the connector type. For information about the secrets configuration properties, refer to Connectors.
Remember these values. You must provide them each time you call the update API.
Jira connectors
-
apiToken
- (Required, string) The Jira API authentication token for HTTP basic authentication.
-
email
- (Required, string) The account email for HTTP Basic authentication.
This object is not required for index or server log connectors.
-
Response codes
edit-
200
- Indicates a successful call.
Examples
editPOST api/actions/connector { "name": "my-connector", "connector_type_id": ".index", "config": { "index": "test-index" } }
The API returns the following:
{ "id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad", "connector_type_id": ".index", "name": "my-connector", "config": { "index": "test-index", "refresh": false, "executionTimeField": null }, "is_preconfigured": false, "is_deprecated": false, "is_missing_secrets": false }