> 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-docs-de/kilo-iot-server/api/examples.md).

# Beispiele

Authentifizierungsbeispiele für die Kilo-IoT-API — curl-REST- und gRPC-Header mit X-API-Key und X-Organization-Id.

Diese Beispiele zeigen, wie man sich authentifiziert. Für die Operationen selbst siehe die [API-Referenz](https://api.kiloiot.io/).

## Authentifizierte REST-Anfrage

Ersetzen Sie die Platzhalter durch Ihren Schlüssel und Ihre Organisations-ID:

```bash
curl -sS https://api.kiloiot.io/api/v2/devices \
  -H "X-API-Key: $KILO_API_KEY" \
  -H "X-Organization-Id: $KILO_ORG_ID"
```

`GET /api/v2/devices` gibt die Geräte zurück, die der Schlüssel sehen darf (dafür ist ein Devices **Lesen** -Bereich erforderlich). Verwenden Sie für andere Aufrufe dieselben beiden Header; prüfen Sie in der API-Referenz den Pfad und den jeweils erforderlichen Bereich.

## gRPC

gRPC verwendet dieselben Header. Für native gRPC-Client-Definitionen verwenden Sie die Materialien, die mit Ihrem On-Premise- oder Integrationspaket bereitgestellt wurden.

## Bewährte Praxis

* Bewahren Sie den Schlüssel in einer Umgebungsvariable oder einem Secret Store auf — niemals in der Shell-Historie oder in der Versionsverwaltung.
* Verwenden Sie pro Integration einen eigenen Schlüssel mit nur den Berechtigungen, die er benötigt.
* Siehe [Authentifizierung & API-Schlüssel](/kilo-docs-de/kilo-iot-server/api/authentication-and-api-keys.md) für die vollständigen Hinweise.


---

# 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-docs-de/kilo-iot-server/api/examples.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.
