ActionsClient (deprecated)

Deprecated alias of the Connectors API client.

Warning

Kibana renamed “actions” to “connectors”. The REST API still lives under /api/actions, but the canonical client namespace is now client.connectors. client.actions remains as a thin backwards-compatible alias and will be removed in a future release. Use ConnectorsClient via client.connectors instead — see ConnectorsClient for full documentation.

Migrating is a rename only; every method keeps the same signature:

from kibana import Kibana

client = Kibana("http://localhost:5601", api_key="your_api_key")

# Deprecated, but still works:
client.actions.list_types()

# Prefer this:
client.connectors.list_types()
class kibana.ActionsClient(client, default_space_id=None, validate_spaces=True)[source]

Bases: ConnectorsClient

Deprecated alias for ConnectorsClient.

Deprecated since version Kibana: renamed “actions” to “connectors”; the REST API lives under /api/actions but the canonical client namespace is now client.connectors. client.actions remains as a thin backwards-compatible alias and will be removed in a future release. Use client.connectors instead.

All methods are inherited unchanged from ConnectorsClient; see that class for full documentation.

Example

>>> from kibana import Kibana
>>> client = Kibana("http://localhost:5601", api_key="...")
>>> # Prefer this:
>>> client.connectors.list_types()
>>> # Deprecated, but still works:
>>> client.actions.list_types()

All methods are inherited unchanged from ConnectorsClient; see ConnectorsClient for usage examples.

__init__(client, default_space_id=None, validate_spaces=True)

Initialize ConnectorsClient with optional space context.

Parameters:
  • client (Any) – Parent BaseClient instance to delegate HTTP requests to.

  • default_space_id (str | None) – Optional default space ID for all operations. If provided, all operations will be scoped to this space unless overridden with the space_id parameter.

  • validate_spaces (bool) – Whether to validate space existence before operations. When True (default), the client verifies that spaces exist before making API calls. Set to False for better performance if you are certain spaces exist.

create(*, name, connector_type_id, id=None, config=None, secrets=None, space_id=None, validate_space=None)

Create a connector.

Creates a new connector, optionally with a caller-specified ID (POST /api/actions/connector or POST /api/actions/connector/{id}).

Parameters:
  • name (str) – The display name for the connector.

  • connector_type_id (str) – The connector type (e.g. .email, .slack, .webhook, .index, .server-log).

  • id (str | None) – Optional caller-specified connector ID (1-36 characters). Useful for reproducible or pre-provisioned connector IDs. When omitted, Kibana generates a random UUID.

  • config (dict[str, Any] | None) – The connector configuration details (non-sensitive data). Optional; defaults to {} on the server. Connector types without configuration (e.g. .server-log, .slack) do not need it.

  • secrets (dict[str, Any] | None) – The connector secrets (sensitive data such as API keys, passwords, or tokens). Defaults to {} on the server.

  • space_id (str | None) – Optional space ID to create the connector in.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the created connector details.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> # Create a webhook connector
>>> connector = client.connectors.create(
...     name="Alert Webhook",
...     connector_type_id=".webhook",
...     config={"url": "https://example.com/webhook"},
...     secrets={"user": "admin", "password": "secret"},
... )
>>> print(connector.body["id"])
>>>
>>> # Create a server-log connector with a fixed ID (no config)
>>> connector = client.connectors.create(
...     id="my-server-log",
...     name="Server Log",
...     connector_type_id=".server-log",
... )
delete(*, id, space_id=None, validate_space=None)

Delete a connector.

Deletes a connector by ID (DELETE /api/actions/connector/{id}). WARNING: this action cannot be undone.

Parameters:
  • id (str) – The connector ID to delete.

  • space_id (str | None) – Optional space ID where the connector exists.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with an empty body (HTTP 204 on success).

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> client.connectors.delete(id="my-old-connector")
execute(*, id, params, space_id=None, validate_space=None)

Run a connector.

Runs a connector by ID with type-specific parameters (POST /api/actions/connector/{id}/_execute).

Parameters:
  • id (str) – The connector ID to run.

  • params (dict[str, Any]) – Execution parameters, whose shape depends on the connector type. For example, .server-log takes {"message": ...}, .index takes {"documents": [...]}.

  • space_id (str | None) – Optional space ID where the connector exists.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the execution result (status is "ok" or "error").

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> # Run a server-log connector
>>> result = client.connectors.execute(
...     id="my-server-log",
...     params={"message": "Alert triggered!", "level": "info"},
... )
>>> print(result.body["status"])
>>>
>>> # Run an index connector
>>> result = client.connectors.execute(
...     id="my-index-connector",
...     params={"documents": [{"message": "hello"}]},
... )
get(*, id, space_id=None, validate_space=None)

Get connector information.

Retrieves a connector by ID (GET /api/actions/connector/{id}).

Parameters:
  • id (str) – The connector ID.

  • space_id (str | None) – Optional space ID to get the connector from.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the connector details.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> connector = client.connectors.get(id="my-webhook-connector")
>>> print(connector.body["name"])
>>> print(connector.body["connector_type_id"])
get_all(*, space_id=None, validate_space=None)

Get all connectors.

Retrieves all connectors in a space (GET /api/actions/connectors).

Parameters:
  • space_id (str | None) – Optional space ID to get connectors from.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse whose body is the list of connectors.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> connectors = client.connectors.get_all()
>>> for connector in connectors.body:
...     print(f"{connector['name']}: {connector['connector_type_id']}")
get_oauth_callback_script(*, space_id=None, validate_space=None)

Get the OAuth callback script.

Returns the JavaScript used by the OAuth callback completion page (GET /api/actions/connector/_oauth_callback_script). Added in Kibana 9.4.0.

Parameters:
  • space_id (str | None) – Optional space ID scoping the request.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

TextApiResponse whose body is the JavaScript source (content-type: application/javascript).

Raises:
Return type:

ApiResponse[Any]

Example

>>> script = client.connectors.get_oauth_callback_script()
>>> print(script.body[:40])
list_types(*, feature_id=None, space_id=None, validate_space=None)

Get connector types.

Retrieves the available connector types (GET /api/actions/connector_types). No Kibana feature privileges are required to run this API.

Parameters:
  • feature_id (str | None) – Optional filter to limit the retrieved connector types to those that support a specific feature, such as alerting, cases, uptime, or siem.

  • space_id (str | None) – Optional space ID to list connector types in.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse whose body is the list of connector types.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> types = client.connectors.list_types()
>>> for connector_type in types.body:
...     print(f"{connector_type['id']}: {connector_type['name']}")
>>>
>>> # Only connector types usable by alerting rules
>>> alerting_types = client.connectors.list_types(feature_id="alerting")
oauth_callback(*, code=None, state=None, error=None, error_description=None, session_state=None, space_id=None, validate_space=None)

Handle OAuth callback.

Handles the OAuth 2.0 authorization code callback from external providers and exchanges the authorization code for access and refresh tokens (GET /api/actions/connector/_oauth_callback). Added in Kibana 9.4.0.

This endpoint is normally invoked by the user’s browser as the OAuth provider’s redirect URI; Kibana responds with an HTML page (or a redirect) that completes the flow.

Parameters:
  • code (str | None) – The authorization code returned by the OAuth provider.

  • state (str | None) – The state parameter for CSRF protection.

  • error (str | None) – Error code if the authorization failed.

  • error_description (str | None) – Human-readable error description.

  • session_state (str | None) – Session state from the OAuth provider (e.g. Microsoft).

  • space_id (str | None) – Optional space ID scoping the callback.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

TextApiResponse with the HTML completion page (HTTP 200), or the result of a redirect (HTTP 302).

Raises:
Return type:

ApiResponse[Any]

Example

>>> response = client.connectors.oauth_callback(
...     code="authorization-code",
...     state="csrf-state-token",
... )
>>> print(response.meta.status)
perform_request(method, path, *, params=None, headers=None, body=None)

Perform an HTTP request via the parent client with space context enhancement.

Parameters:
  • method (str) – HTTP method (GET, POST, PUT, DELETE, etc.)

  • path (str) – API endpoint path

  • params (dict[str, Any] | None) – Query parameters

  • headers (dict[str, str] | None) – Request headers

  • body (dict[str, Any] | None) – Request body

Returns:

API response

Raises:

ApiError – If the API returns an error response (enhanced with space context)

Return type:

ObjectApiResponse[Any]

update(*, id, name, config=None, secrets=None, space_id=None, validate_space=None)

Update a connector.

Fully replaces a connector’s user-editable attributes (PUT /api/actions/connector/{id}). This is a full-replace PUT, not a partial update: name is required, and any omitted config or secrets are reset to {} on the server. Connector types with required configuration fields (e.g. .index, .webhook) therefore reject updates that omit config. The connector type itself cannot be changed.

Parameters:
  • id (str) – The connector ID to update.

  • name (str) – The display name for the connector (required by the API).

  • config (dict[str, Any] | None) – The full connector configuration to store. Omitting it resets the configuration to {}; pass the complete desired configuration (fetch and merge the current one if needed).

  • secrets (dict[str, Any] | None) – The full connector secrets to store. Omitting it resets the secrets to {}.

  • space_id (str | None) – Optional space ID where the connector exists.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the updated connector details.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> # Full replace: always pass name and the complete config
>>> updated = client.connectors.update(
...     id="my-webhook-connector",
...     name="Updated Webhook",
...     config={"url": "https://new-endpoint.com/webhook"},
...     secrets={"user": "admin", "password": "new-secret"},
... )

AsyncActionsClient

Deprecated alias of AsyncConnectorsClient. Use client.connectors on AsyncKibana instead.

class kibana._async.client.actions.AsyncActionsClient(client, default_space_id=None, validate_spaces=True)[source]

Bases: AsyncConnectorsClient

Deprecated alias for AsyncConnectorsClient.

Deprecated since version Kibana: renamed “actions” to “connectors”; the REST API lives under /api/actions but the canonical client namespace is now client.connectors. client.actions remains as a thin backwards-compatible alias and will be removed in a future release. Use client.connectors instead.

All methods are inherited unchanged from AsyncConnectorsClient; see that class for full documentation.

Example

>>> from kibana import AsyncKibana
>>> client = AsyncKibana("http://localhost:5601", api_key="...")
>>> # Prefer this:
>>> await client.connectors.list_types()
>>> # Deprecated, but still works:
>>> await client.actions.list_types()
__init__(client, default_space_id=None, validate_spaces=True)

Initialize AsyncConnectorsClient with optional space context.

Parameters:
  • client (Any) – Parent AsyncBaseClient instance to delegate HTTP requests to.

  • default_space_id (str | None) – Optional default space ID for all operations. If provided, all operations will be scoped to this space unless overridden with the space_id parameter.

  • validate_spaces (bool) – Whether to validate space existence before operations. When True (default), the client verifies that spaces exist before making API calls. Set to False for better performance if you are certain spaces exist.

async create(*, name, connector_type_id, id=None, config=None, secrets=None, space_id=None, validate_space=None)

Create a connector.

Creates a new connector, optionally with a caller-specified ID (POST /api/actions/connector or POST /api/actions/connector/{id}).

Parameters:
  • name (str) – The display name for the connector.

  • connector_type_id (str) – The connector type (e.g. .email, .slack, .webhook, .index, .server-log).

  • id (str | None) – Optional caller-specified connector ID (1-36 characters). Useful for reproducible or pre-provisioned connector IDs. When omitted, Kibana generates a random UUID.

  • config (dict[str, Any] | None) – The connector configuration details (non-sensitive data). Optional; defaults to {} on the server. Connector types without configuration (e.g. .server-log, .slack) do not need it.

  • secrets (dict[str, Any] | None) – The connector secrets (sensitive data such as API keys, passwords, or tokens). Defaults to {} on the server.

  • space_id (str | None) – Optional space ID to create the connector in.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the created connector details.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> # Create a webhook connector
>>> connector = await client.connectors.create(
...     name="Alert Webhook",
...     connector_type_id=".webhook",
...     config={"url": "https://example.com/webhook"},
...     secrets={"user": "admin", "password": "secret"},
... )
>>> print(connector.body["id"])
>>>
>>> # Create a server-log connector with a fixed ID (no config)
>>> connector = await client.connectors.create(
...     id="my-server-log",
...     name="Server Log",
...     connector_type_id=".server-log",
... )
async delete(*, id, space_id=None, validate_space=None)

Delete a connector.

Deletes a connector by ID (DELETE /api/actions/connector/{id}). WARNING: this action cannot be undone.

Parameters:
  • id (str) – The connector ID to delete.

  • space_id (str | None) – Optional space ID where the connector exists.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with an empty body (HTTP 204 on success).

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> await client.connectors.delete(id="my-old-connector")
async execute(*, id, params, space_id=None, validate_space=None)

Run a connector.

Runs a connector by ID with type-specific parameters (POST /api/actions/connector/{id}/_execute).

Parameters:
  • id (str) – The connector ID to run.

  • params (dict[str, Any]) – Execution parameters, whose shape depends on the connector type. For example, .server-log takes {"message": ...}, .index takes {"documents": [...]}.

  • space_id (str | None) – Optional space ID where the connector exists.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the execution result (status is "ok" or "error").

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> # Run a server-log connector
>>> result = await client.connectors.execute(
...     id="my-server-log",
...     params={"message": "Alert triggered!", "level": "info"},
... )
>>> print(result.body["status"])
>>>
>>> # Run an index connector
>>> result = await client.connectors.execute(
...     id="my-index-connector",
...     params={"documents": [{"message": "hello"}]},
... )
async get(*, id, space_id=None, validate_space=None)

Get connector information.

Retrieves a connector by ID (GET /api/actions/connector/{id}).

Parameters:
  • id (str) – The connector ID.

  • space_id (str | None) – Optional space ID to get the connector from.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the connector details.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> connector = await client.connectors.get(id="my-webhook-connector")
>>> print(connector.body["name"])
>>> print(connector.body["connector_type_id"])
async get_all(*, space_id=None, validate_space=None)

Get all connectors.

Retrieves all connectors in a space (GET /api/actions/connectors).

Parameters:
  • space_id (str | None) – Optional space ID to get connectors from.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse whose body is the list of connectors.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> connectors = await client.connectors.get_all()
>>> for connector in connectors.body:
...     print(f"{connector['name']}: {connector['connector_type_id']}")
async get_oauth_callback_script(*, space_id=None, validate_space=None)

Get the OAuth callback script.

Returns the JavaScript used by the OAuth callback completion page (GET /api/actions/connector/_oauth_callback_script). Added in Kibana 9.4.0.

Parameters:
  • space_id (str | None) – Optional space ID scoping the request.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

TextApiResponse whose body is the JavaScript source (content-type: application/javascript).

Raises:
Return type:

ApiResponse[Any]

Example

>>> script = await client.connectors.get_oauth_callback_script()
>>> print(script.body[:40])
async list_types(*, feature_id=None, space_id=None, validate_space=None)

Get connector types.

Retrieves the available connector types (GET /api/actions/connector_types). No Kibana feature privileges are required to run this API.

Parameters:
  • feature_id (str | None) – Optional filter to limit the retrieved connector types to those that support a specific feature, such as alerting, cases, uptime, or siem.

  • space_id (str | None) – Optional space ID to list connector types in.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse whose body is the list of connector types.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> types = await client.connectors.list_types()
>>> for connector_type in types.body:
...     print(f"{connector_type['id']}: {connector_type['name']}")
>>>
>>> # Only connector types usable by alerting rules
>>> alerting_types = await client.connectors.list_types(
...     feature_id="alerting"
... )
async oauth_callback(*, code=None, state=None, error=None, error_description=None, session_state=None, space_id=None, validate_space=None)

Handle OAuth callback.

Handles the OAuth 2.0 authorization code callback from external providers and exchanges the authorization code for access and refresh tokens (GET /api/actions/connector/_oauth_callback). Added in Kibana 9.4.0.

This endpoint is normally invoked by the user’s browser as the OAuth provider’s redirect URI; Kibana responds with an HTML page (or a redirect) that completes the flow.

Parameters:
  • code (str | None) – The authorization code returned by the OAuth provider.

  • state (str | None) – The state parameter for CSRF protection.

  • error (str | None) – Error code if the authorization failed.

  • error_description (str | None) – Human-readable error description.

  • session_state (str | None) – Session state from the OAuth provider (e.g. Microsoft).

  • space_id (str | None) – Optional space ID scoping the callback.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

TextApiResponse with the HTML completion page (HTTP 200), or the result of a redirect (HTTP 302).

Raises:
Return type:

ApiResponse[Any]

Example

>>> response = await client.connectors.oauth_callback(
...     code="authorization-code",
...     state="csrf-state-token",
... )
>>> print(response.meta.status)
async perform_request(method, path, *, params=None, headers=None, body=None)

Perform an async HTTP request via the parent client with space context enhancement.

Parameters:
  • method (str) – HTTP method (GET, POST, PUT, DELETE, etc.)

  • path (str) – API endpoint path

  • params (dict[str, Any] | None) – Query parameters

  • headers (dict[str, str] | None) – Request headers

  • body (dict[str, Any] | None) – Request body

Returns:

API response

Raises:

ApiError – If the API returns an error response (enhanced with space context)

Return type:

ObjectApiResponse[Any]

async update(*, id, name, config=None, secrets=None, space_id=None, validate_space=None)

Update a connector.

Fully replaces a connector’s user-editable attributes (PUT /api/actions/connector/{id}). This is a full-replace PUT, not a partial update: name is required, and any omitted config or secrets are reset to {} on the server. Connector types with required configuration fields (e.g. .index, .webhook) therefore reject updates that omit config. The connector type itself cannot be changed.

Parameters:
  • id (str) – The connector ID to update.

  • name (str) – The display name for the connector (required by the API).

  • config (dict[str, Any] | None) – The full connector configuration to store. Omitting it resets the configuration to {}; pass the complete desired configuration (fetch and merge the current one if needed).

  • secrets (dict[str, Any] | None) – The full connector secrets to store. Omitting it resets the secrets to {}.

  • space_id (str | None) – Optional space ID where the connector exists.

  • validate_space (bool | None) – Override space validation setting for this operation.

Returns:

ObjectApiResponse with the updated connector details.

Raises:
Return type:

ObjectApiResponse[Any]

Example

>>> # Full replace: always pass name and the complete config
>>> updated = await client.connectors.update(
...     id="my-webhook-connector",
...     name="Updated Webhook",
...     config={"url": "https://new-endpoint.com/webhook"},
...     secrets={"user": "admin", "password": "new-secret"},
... )