API Reference

Complete API reference for the Kibana Python client.

This section provides detailed documentation for all public classes, methods, and exceptions in the kibana-py library. The documentation is automatically generated from code docstrings and includes usage examples.

The client covers the Kibana 9.4 platform, Fleet and Security Solution APIs across 39 namespaces — headlined by the new Dashboards HTTP API (technical preview) — with full synchronous and asynchronous parity.

Overview

The Kibana Python client provides both synchronous and asynchronous interfaces for interacting with Kibana’s REST API. The client is organized into namespace clients that group related functionality:

Main Clients

  • Kibana - Synchronous client for Kibana API

  • AsyncKibana - Asynchronous client for Kibana API

  • SpaceScopedKibana - Space-scoped synchronous client

  • AsyncSpaceScopedKibana - Space-scoped asynchronous client

Namespace Clients

Analytics

Alerting

Observability

Management

AI

Fleet

Security Solution

Exception Classes

Quick Start

Synchronous Client

from kibana import Kibana

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

# Use namespace clients
status = client.status.get_status()
dashboards = client.dashboards.get_all()
connectors = client.connectors.get_all()
spaces = client.spaces.get_all()

# Close client
client.close()

Asynchronous Client

from kibana import AsyncKibana
import asyncio

async def main():
    # Initialize async client
    async with AsyncKibana("http://localhost:5601") as client:
        # Use namespace clients with await
        status = await client.status.get_status()
        dashboards = await client.dashboards.get_all()
        connectors = await client.connectors.get_all()
        spaces = await client.spaces.get_all()

asyncio.run(main())

Space-Scoped Operations

from kibana import Kibana

client = Kibana("http://localhost:5601")

# Create space-scoped client
marketing_client = client.space("marketing")

# All operations are scoped to "marketing" space
dashboard = marketing_client.dashboards.create(
    title="Marketing KPIs"
)
connector = marketing_client.connectors.create(
    name="Marketing Webhook",
    connector_type_id=".webhook",
    config={"url": "https://example.com/webhook"}
)

Error Handling

from kibana import Kibana
from kibana.exceptions import (
    NotFoundError,
    BadRequestError,
    SpaceNotFoundError
)

client = Kibana("http://localhost:5601")

try:
    connector = client.connectors.get(id="my-connector")
except NotFoundError:
    print("Connector not found")
except BadRequestError as e:
    print(f"Invalid request: {e.message}")
except SpaceNotFoundError as e:
    print(f"Space not found: {e.space_id}")

See Also