> For the complete documentation index, see [llms.txt](https://docs.kiloiot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kiloiot.io/kilo-iot-server/api.md).

# API

The Kilo IoT Platform exposes programmatic access so external systems can read and manage your deployment's data and configuration — and now send commands to your devices — covering backend integrations, analytics and reporting pipelines, industrial and automation tooling, and custom applications.

Use the [**API reference**](https://api.kiloiot.io/) for the complete list of endpoints, request fields, responses, and required scopes. This section covers what the API is for, how to choose a protocol, how requests authenticate, and where to manage keys.

> Device control is part of the API: a key with the **Commands** scope can create a device's commands and dispatch them as downlinks (on/off, setpoints, and the like). See [Device Commands](/kilo-iot-server/devices/commands.md) for the in-app workflow, and the [API reference](https://api.kiloiot.io/#tag/commands) for the command endpoints.

## What's available

Two protocols are offered on the same secured endpoint:

* **REST** — the primary path for most integrations. Standard HTTPS and JSON, usable from any HTTP client. Start here unless you have a specific reason not to. See [Public REST API](/kilo-iot-server/api/public-rest-api.md).
* **gRPC** — the advanced / on-premise path. Choose REST unless you specifically need gRPC for an on-premise or typed service-to-service integration. See [gRPC API](/kilo-iot-server/api/grpc-api.md).

Alongside them, a separate endpoint serves AI clients rather than code you write:

* **MCP** — connect an MCP-capable AI client, such as Claude Code or Claude Desktop, to your organization. You authorize it in the browser with your usual Kilo account instead of issuing a key, and it works within your own permissions. See [MCP Server](/kilo-iot-server/api/mcp-server.md).

## Authentication

Requests are authenticated with a scoped API key in the `X-API-Key` header (format `kilo_<key>`), plus your organization context in `X-Organization-Id`. Keys are created and managed in **Settings → API Keys**; the concepts are summarized in [Authentication & API keys](/kilo-iot-server/api/authentication-and-api-keys.md), and the full key-management workflow is in [API Keys](/kilo-iot-server/settings/api-keys.md).

## Cloud and on-premise

Cloud deployments use the managed endpoint above. On-premise installations expose the same API within your own network boundary, where gRPC is a natural fit for internal service-to-service automation — but REST remains available and is still the simplest place to start.

## In this section

* [Public REST API](/kilo-iot-server/api/public-rest-api.md) — the standard integration path.
* [gRPC API](/kilo-iot-server/api/grpc-api.md) — the advanced / on-premise path (typed, service-to-service).
* [MCP Server](/kilo-iot-server/api/mcp-server.md) — connect your own AI client to your organization.
* [Authentication & API keys](/kilo-iot-server/api/authentication-and-api-keys.md) — how requests are authorized.
* [Examples](/kilo-iot-server/api/examples.md) — a minimal authenticated request to get started.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kiloiot.io/kilo-iot-server/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
