Datei in einen Space hochladen
Upload a file using multipart/form-data. The response is an NDJSON stream (newline-delimited JSON).
Each line is a JSON object of one of three types:
type | Description |
|---|---|
progress | Periodic upload-progress update. |
complete | Upload finished. The url field (e.g. /f/abc123) is the permanent reference to the file. |
error | Upload failed. The error field contains a human-readable message. |
Computing the hash field — calculate the SHA-256 of the raw file bytes and encode it with base64url (no padding).
Most languages ship this natively. Example in Node.js:
import crypto from 'crypto';
const hash = crypto.createHash('sha256').update(buffer).digest('base64url');
The server re-calculates the hash after receiving the file and rejects the request if the values differ, so the hash also acts as an integrity check.
Deduplication — if a file with the same hash already exists in the target space the server returns a
complete event immediately without re-uploading the bytes (alreadyExisted: true).
| Request Body — REQUIRED |
|---|
file binary — REQUIREDThe file to upload. |
hash string — REQUIREDSHA-256 of the file bytes, base64url-encoded (no padding). Used for integrity verification and deduplication. |
spaceId stringID of the space to upload the file into. Defaults to the authenticated user's personal space. |
shareWith stringID of an additional space to share the file with. |
chunkId uuidOptional: UUIDv7 to use as the card/chunk ID. Auto-generated when omitted. |
cardId uuidAlias for |
chatId stringVerknüpft den Upload mit einer bestehenden Chat-ID. |
botId integerWhen set, the file is treated as a source for this bot. |
facets stringJSON-encoded object of string key/value facets to attach to the file (e.g. |
| Responses | |||
|---|---|---|---|
200NDJSON stream. Each line is one of the objects described below. The final line has
| |||
401Unauthorized — missing or invalid bearer token.
|