ControlPlaneClient
The main entry point for interacting with the Kubiya Control Plane API.Class: ControlPlaneClient
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | Kubiya API key. If not provided, reads from KUBIYA_API_KEY env var |
base_url | str | "https://control-plane.kubiya.ai" | Control Plane API endpoint URL |
timeout | int | 300 | Request timeout in seconds |
max_retries | int | 3 | Number of retries for failed requests |
org_name | str | None | Organization name (for multi-org accounts) |
Services
The client provides access to these services:client.health- Health Serviceclient.agents- Agents Serviceclient.teams- Teams Serviceclient.projects- Projects Serviceclient.environments- Environments Serviceclient.jobs- Jobs Serviceclient.graph- Context Graph Serviceclient.models- Models Serviceclient.runtimes- Runtimes Serviceclient.skills- Skills Serviceclient.policies- Policies Serviceclient.workers- Workers Serviceclient.secrets- Secrets Serviceclient.integrations- Integrations Serviceclient.context- Context Serviceclient.task_planning- Task Planning Service
Health Service
client.health.check()
Check health status of the Control Plane.
client.health.ready()
Check if Control Plane is ready to accept requests.
client.health.detailed()
Get detailed health including database, Redis, and Temporal status.
Agents Service
client.agents.list(skip=0, limit=100, status_filter=None)
List all agents in the organization.
skip(int): Number of records to skip for paginationlimit(int): Maximum number of records to returnstatus_filter(str, optional): Filter by status
client.agents.get(agent_id)
Get a specific agent by ID.
client.agents.create(agent_data)
Create a new agent.
client.agents.update(agent_id, agent_data)
Update an existing agent.
client.agents.delete(agent_id)
Delete an agent.
client.agents.execute(agent_id, execution_data)
Execute an agent task via Temporal workflow.
Teams Service
client.teams.list(skip=0, limit=100, status_filter=None)
List all teams in the organization.
skip(int): Number of records to skiplimit(int): Maximum number of recordsstatus_filter(str, optional): Filter by status (‘active’, ‘inactive’, ‘archived’, ‘idle’)
client.teams.get(team_id)
Get a specific team by ID.
client.teams.create(team_data)
Create a new team.
client.teams.update(team_id, team_data)
Update an existing team.
client.teams.delete(team_id)
Delete a team.
client.teams.add_agent(team_id, agent_id)
Add an agent to a team.
client.teams.remove_agent(team_id, agent_id)
Remove an agent from a team.
client.teams.execute(team_id, execution_data)
Execute a team task.
client.teams.execute_stream(team_id, execution_data)
Execute a team task with streaming response.
Jobs Service
client.jobs.list(enabled=None, trigger_type=None)
List all jobs.
enabled(bool, optional): Filter by enabled statustrigger_type(str, optional): Filter by trigger type (‘cron’, ‘webhook’, ‘manual’)
client.jobs.get(job_id)
Get a specific job.
client.jobs.create(job_data)
Create a new job.
client.jobs.update(job_id, job_data)
Update a job.
client.jobs.delete(job_id)
Delete a job.
client.jobs.trigger(job_id, parameters=None, config_override=None)
Manually trigger a job.
client.jobs.enable(job_id)
Enable a job and unpause its schedule.
client.jobs.disable(job_id)
Disable a job and pause its schedule.
client.jobs.get_executions(job_id, limit=50, offset=0)
Get execution history for a job.
Context Graph Service
client.graph.health()
Check health of the context graph service.
client.graph.list_nodes(integration=None, skip=0, limit=100)
List nodes in the context graph.
client.graph.get_node(node_id, integration=None)
Get a specific node by ID.
client.graph.search_nodes(search_data, integration=None, skip=0, limit=100)
Search nodes using structured query.
client.graph.search_nodes_by_text(text_query, integration=None, skip=0, limit=100)
Search nodes using text query.
client.graph.get_relationships(node_id, direction=None, relationship_type=None, integration=None, skip=0, limit=100)
Get relationships for a node.
client.graph.get_subgraph(node_id, depth=1, integration=None)
Get a subgraph starting from a node.
client.graph.list_labels(integration=None, skip=0, limit=100)
Get all node labels (types) in the graph.
client.graph.list_relationship_types(integration=None, skip=0, limit=100)
Get all relationship types.
client.graph.get_stats(integration=None, skip=0, limit=100)
Get graph statistics.
client.graph.execute_query(query)
Execute a custom Cypher query.
client.graph.list_integrations(skip=0, limit=100)
Get all integrations in the context graph.
Projects Service
client.projects.list(skip=0, limit=100)
List all projects.
client.projects.get(project_id)
Get a specific project.
client.projects.create(project_data)
Create a new project.
client.projects.update(project_id, project_data)
Update a project.
client.projects.delete(project_id)
Delete a project.
Environments Service
client.environments.list(skip=0, limit=100)
List all environments.
client.environments.get(environment_id)
Get a specific environment.
client.environments.create(environment_data)
Create a new environment.
client.environments.update(environment_id, environment_data)
Update an environment.
client.environments.delete(environment_id)
Delete an environment.
Models Service
client.models.list()
List available LLM models.
client.models.get(model_id)
Get a specific model.
client.models.get_default()
Get the default model.
Skills Service
client.skills.list()
List all skills.
client.skills.get(skill_id)
Get a specific skill.
client.skills.associate(entity_id, skill_ids)
Associate skills with an entity.
Policies Service
client.policies.list()
List all policies.
client.policies.get(policy_id)
Get a specific policy.
client.policies.create(policy_data)
Create a new policy.
client.policies.update(policy_id, policy_data)
Update a policy.
client.policies.delete(policy_id)
Delete a policy.
Secrets Service
client.secrets.list()
List secrets (metadata only).
client.secrets.get_value(name)
Get a secret value.
Integrations Service
client.integrations.list()
List all integrations.
client.integrations.get_integration_credentials(vendor, id)
Get credentials for an integration.
Task Planning Service
client.task_planning.plan(task_description, context=None)
Generate a task plan from a description.
client.task_planning.plan_stream(task_description, context=None)
Generate a task plan with streaming updates.
Workers Service
client.workers.list()
List all workers.
client.workers.get(worker_id)
Get a specific worker.
Context Service
client.context.resolve(entity_id)
Resolve entity context with inheritance.
Exceptions
Control Plane Exceptions
Example Error Handling
Environment Variables
| Variable | Description | Default |
|---|---|---|
KUBIYA_API_KEY | API key for authentication | None |
KUBIYA_CONTROL_PLANE_BASE_URL | Control Plane API URL | https://control-plane.kubiya.ai |