> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnifact.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dokumente-API

> Dokumente in den Hochgeladenen Dateien eines Space programmgesteuert hochladen, auflisten, prüfen, umbenennen und löschen

Die Dokumente-API ermöglicht es Entwicklern, Dokumente innerhalb von Space-Hochgeladenen-Dateien programmgesteuert zu verwalten. Dies ermöglicht die automatisierte Erfassung von Dokumenten aus externen CMS, Datenpipelines oder Dokumentenmanagementsystemen.

## Basis-Pfad & Header

Alle Dokument-Endpunkte erfordern den Authentifizierungsheader `X-API-Key`:

```http theme={null}
X-API-Key: ihr_omnifact_api_schluessel_hier
```

***

## Health-Check Ping

`GET /`

Überprüft, ob der API-Dienst online und erreichbar ist.

#### Beispielanfrage

```bash theme={null}
curl -X GET "https://connect.omnifact.ai/" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier"
```

#### Antwort (`200 OK`)

```json theme={null}
{
  "status": "ok",
  "timestamp": "2026-08-03T12:00:00.000Z"
}
```

***

## Unterstützte Dateitypen auflisten

`GET /v1/documents/supported-file-types`

Gibt eine Liste aller unterstützten MIME-Typen und Dateiendungen für die Dokumentenerfassung zurück.

#### Beispielanfrage

```bash theme={null}
curl -X GET "https://connect.omnifact.ai/v1/documents/supported-file-types" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier"
```

#### Antwort (`200 OK`)

```json theme={null}
{
  "supportedMimeTypes": [
    "application/pdf",
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    "text/plain",
    "text/csv",
    "text/markdown"
  ],
  "supportedExtensions": [".pdf", ".docx", ".txt", ".csv", ".md"]
}
```

***

## Dokumente auflisten

`GET /v1/documents`

Ruft Dokumente in den Hochgeladenen Dateien eines Space ab. Filtern Sie nach `spaceId` und paginieren Sie durch die Ergebnisse mit `offset` und `limit`.

#### Abfrageparameter

| Parameter | Typ       | Erforderlich | Beschreibung                                                                |
| :-------- | :-------- | :----------- | :-------------------------------------------------------------------------- |
| `spaceId` | `string`  | Erforderlich | Dokumente filtern, die zu einer bestimmten Space-UUID gehören.              |
| `offset`  | `integer` | Optional     | Anzahl der zu überspringenden Elemente (Standard: `0`).                     |
| `limit`   | `integer` | Optional     | Maximale Anzahl der zurückzugebenden Elemente (Standard: `20`, Max: `100`). |

#### Beispielanfrage

```bash theme={null}
curl -X GET "https://connect.omnifact.ai/v1/documents?spaceId=spc_12345&offset=0&limit=10" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier"
```

#### Antwort (`200 OK`)

```json theme={null}
{
  "total": 1,
  "limit": 10,
  "offset": 0,
  "items": [
    {
      "id": "doc_98765",
      "spaceId": "spc_12345",
      "name": "Mitarbeiterhandbuch_2026.pdf",
      "status": "ready",
      "metadata": {
        "url": "https://example.com/handbuch.pdf"
      }
    }
  ]
}
```

***

## Dokument hochladen

`POST /v1/documents`

Lädt eine neue Dokumentdatei in die Hochgeladenen Dateien eines Space hoch. Der Upload wird asynchron verarbeitet (Inhalt extrahiert, in Abschnitte geteilt und vektorindexiert).

#### Abfrageparameter

| Parameter | Typ      | Erforderlich | Beschreibung     |
| :-------- | :------- | :----------- | :--------------- |
| `spaceId` | `string` | Erforderlich | Ziel-Space-UUID. |

#### Anfragenachricht (`multipart/form-data`)

| Feld       | Typ      | Erforderlich | Beschreibung                                                                   |
| :--------- | :------- | :----------- | :----------------------------------------------------------------------------- |
| `file`     | `file`   | Erforderlich | Die hochzuladende Binärdatei.                                                  |
| `name`     | `string` | Optional     | Überschreibt den ursprünglichen Dateinamen.                                    |
| `metadata` | `object` | Optional     | Optionale JSON-Metadaten (ein `url`-Feld wird als Link bei Zitaten angezeigt). |

#### Beispielanfrage

```bash theme={null}
curl -X POST "https://connect.omnifact.ai/v1/documents?spaceId=spc_12345" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier" \
  -F "file=@/pfad/zu/richtlinie.pdf" \
  -F "name=Unternehmensrichtlinie_2026.pdf"
```

#### Antwort (`201 Created`)

```json theme={null}
{
  "id": "doc_98765",
  "spaceId": "spc_12345",
  "name": "Unternehmensrichtlinie_2026.pdf",
  "status": "processing"
}
```

***

## Dokumentdetails abrufen

`GET /v1/documents/{id}`

Ruft Metadaten und den Verarbeitungsstatus für ein bestimmtes Dokument ab.

#### Pfadparameter

| Parameter | Typ      | Beschreibung       |
| :-------- | :------- | :----------------- |
| `id`      | `string` | Die Dokument-UUID. |

#### Beispielanfrage

```bash theme={null}
curl -X GET "https://connect.omnifact.ai/v1/documents/doc_98765" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier"
```

#### Antwort (`200 OK`)

```json theme={null}
{
  "id": "doc_98765",
  "spaceId": "spc_12345",
  "name": "Unternehmensrichtlinie_2026.pdf",
  "status": "ready",
  "metadata": {
    "url": "https://example.com/richtlinie.pdf"
  }
}
```

***

## Dokument aktualisieren

`PATCH /v1/documents/{id}`

Aktualisiert den angezeigten Namen oder das Metadatenobjekt eines Dokuments.

#### Anfragenachricht (`application/json`)

| Feld       | Typ      | Erforderlich | Beschreibung                                                               |
| :--------- | :------- | :----------- | :------------------------------------------------------------------------- |
| `name`     | `string` | Optional     | Neuer Name für das Dokument.                                               |
| `metadata` | `object` | Optional     | Metadatenobjekt (ersetzt bestehende Metadaten; `null` senden zum Löschen). |

#### Beispielanfrage

```bash theme={null}
curl -X PATCH "https://connect.omnifact.ai/v1/documents/doc_98765" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Aktualisierte_Unternehmensrichtlinie_2026.pdf"
  }'
```

#### Antwort (`200 OK`)

```json theme={null}
{
  "id": "doc_98765",
  "spaceId": "spc_12345",
  "name": "Aktualisierte_Unternehmensrichtlinie_2026.pdf",
  "status": "ready"
}
```

***

## Dokument löschen

`DELETE /v1/documents/{id}`

Entfernt ein Dokument und seine indexierten Vektoren dauerhaft aus den Hochgeladenen Dateien des Space.

#### Beispielanfrage

```bash theme={null}
curl -X DELETE "https://connect.omnifact.ai/v1/documents/doc_98765" \
  -H "X-API-Key: ihr_omnifact_api_schluessel_hier"
```

#### Antwort (`204 No Content`)

## Nächste Schritte

* Erfahren Sie mehr über die [Veröffentlichte Spaces Chat-API](/de/api-reference/published-space-chat)
* Lesen Sie [Hochgeladene Dateien verwalten](/de/platform/core-features/spaces/managing-uploaded-files) für Administrator-Anweisungen
