> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/de/apis/ontologies-api.md).

# Ontologie-API

Unitlab Ontologie-API: Workspace-Ontologien per HTTP auflisten, filtern, lesen, erstellen und ersetzen, mit JSON-Struktur und Berechtigungen.

| Methode und Route               | Funktion                                                             | Berechtigung      |
| ------------------------------- | -------------------------------------------------------------------- | ----------------- |
| `GET /api/sdk/ontologies/`      | Ontologien auflisten (paginiert)                                     | View ontology     |
| `POST /api/sdk/ontologies/`     | Eine erstellen                                                       | Manage ontologies |
| `GET /api/sdk/ontologies/{id}/` | Eine lesen                                                           | View ontology     |
| `PUT /api/sdk/ontologies/{id}/` | Titel, Beschreibung und Struktur ersetzen und eine Revision erfassen | Manage ontologies |

Listenfilter: `title_eq`, `title_like`, `desc_eq`, `desc_like`, `created_before`, `created_after`, `edited_before`, `edited_after` (ISO 8601).

```bash
curl -s -X POST https://api.unitlab.ai/api/sdk/ontologies/ \
  -H "Authorization: Api-Key $UNITLAB_API_KEY" -H "Content-Type: application/json" \
  -d @ontology.json
```

```json
{
  "title": "Robot cell QA",
  "description": "Grippers and parts",
  "data_type": "image",
  "structure": {"objects": [], "classifications": [], "skeleton_templates": []}
}
```

Das Feld `ontology_hash` der Antwort ist die Ontologie-ID; übergeben Sie es beim Erstellen eines Projekts. Erstellen Sie `structure` mit `OntologyStructure` und `to_dict()` aus dem SDK oder kopieren Sie sie aus einer vorhandenen Ontologie. Siehe [Ontologien in Python erstellen](https://docs.unitlab.ai/api-sdk-cli/de/sdks/build-ontologies-in-python.md).

## Verwandte Themen <a href="#related" id="related"></a>

[SDK: Ontologie-Ressourcen](https://docs.unitlab.ai/api-sdk-cli/de/sdks/ontology-resources.md) · [Projekte](https://docs.unitlab.ai/api-sdk-cli/de/apis/projects-api.md)
