---
title: "Files, links and storage"
url: https://lumean.app/de/developers/docs/guide/files
locale: de
description: "How to get a link to an order's file, where subtitles are, and how long files are kept."
updated: 2026-10-18
source_locale: en
sources: [get-orders-order, post-storage-url, post-orders-order-retry]
errors: ["404", storage-expired, "403"]
spec_version: 1.0.0
---

# Files, links and storage

A finished order returns its result in `result.files[]`. These are paths inside storage, not
links, and a `GET` on such a string returns nothing. Downloading takes two steps: exchange the
path for a temporary link, then download the file from that link.

## Exchanging a path for a link

| Field | Rule | Default | Purpose |
| --- | --- | --- | --- |
| `path` | required, string | — | A string from `result.files[]` or `result.service_files[]` |
| `download` | boolean | `false` | `true` marks the link as an attachment: the file is saved under the order name (`Order.name`) instead of opening in a tab |
| `number_base` | integer, `0` or `1` | `1` | The number that chunk numbering in the file name starts from |
| `number_padding` | integer, `1..4` | `3` | The width of the chunk number, padded with leading zeros: `3` gives "007" |

`POST /storage/url` takes the full path, exactly as it appears in the order, and returns a
signed temporary link in `data.url`. It is the only operation that requires
[the `orders.download` scope](/developers/docs/guide/authentication). A key with `orders.read`
and `orders.write` can see the order, but its request for a link gets a `403` with no `reason`
field.

The link is valid for about an hour. Download the file with a plain `GET` and no `X-API-KEY`
header: the signature is part of the URL. Don't keep the link for long; request it right before
downloading. If the link has expired, call `POST /storage/url` again with the same path. The
file itself is not affected.

### POST /storage/url

Get File URL

Справочник: https://lumean.app/de/developers/docs/api/post-storage-url

## Main and service files

| Field | Contents |
| --- | --- |
| `result.files[]` | The main result. For text to speech after merging, one element: the final track. For `music`, one file for each of the `n_variants` |
| `result.service_files[]` | `.srt`, `.vtt`, and `.lrc` subtitles, alignment, and `result.json` with word timings |

Both fields are flat arrays of path strings. Subtitles and alignment are only in
`service_files[]`.

Only TTS services produce service files. The `service_files` key is present only when the set
is not empty. For `sfx` and `music`, the key is missing entirely: not `null` and not `[]`. Check
whether the key exists.

`service_files` exists only on the order. `GET /orders/{order}/items/{item}` returns only the
chunk's own `result_file`.

There is no separate file type field. The type follows from the extension and from the
`/service/` segment in the path. `raw_chunk` and `metadata` paths are not visible to an API key,
and requesting a link for one returns `403`.

## Downloading all of an order's files

```text
Конвейер публичного API

Один раз:
  Ключ        X-API-KEY            заголовок в каждом запросе
    ↓
  Права       orders.write         пресет ключа задаёт доступные операции
    ↓
  Голос       GET /voices          voice_id из каталога
    ↓
  Шаблон      POST /templates      voice_id хранится в config.tts_settings

Каждый заказ:
  Шаблон      template_id          готовый шаблон из настройки
    ↓
  Заказ       POST /orders         201, статус created, результата ещё нет
    ↓
  Ожидание    GET /orders/{order}  статус, пока заказ не завершится
    ↓
  Файлы       result.files[]       пути в хранилище, а не ссылки
    ↓
  Ссылка      POST /storage/url    путь → ссылка на скачивание
```

```bash
# 1. The order: paths are in result, and the status must be terminal
curl -s "$BASE/orders/$ORDER_ID" -H "X-API-KEY: $KEY"

# 2. Exchange every path from files[] and service_files[] for a link
curl -s -X POST "$BASE/storage/url" -H "X-API-KEY: $KEY" -H "Content-Type: application/json" \
  -d '{ "path": "storage/501/orders/<ORDER_UUID>/output/final/result.mp3", "download": true }'
# → { "success": true, "data": { "url": "https://s3.lumean.app/…?X-Amz-Signature=…" } }

# 3. Download from data.url with a plain GET, without X-API-KEY
curl -sL -o result.mp3 "$URL"
```

You can also download files from a [`partially_completed`](/developers/docs/guide/async) order:
the successful chunks are already finished. `failed` and `compensated` orders have no files.

## Retention

Order files are deleted 7 days after the order reaches a terminal status: `completed`,
`result_delivered`, `failed`, `compensated`, or `cancelled`. That is the default period. If the
order was merged into a separate final file, the per-chunk tracks are deleted earlier, after
48 hours by default. `GET /orders/{order}` shows the deadlines:

| Field | Meaning |
| --- | --- |
| `files_expire_at`, `retention.files.expires_at` | When all of the order's files will be deleted. `null` means the order is not terminal yet or the files are already gone |
| `files_expired`, `retention.files.expired` | `true` means the files are gone and no link can be issued |
| `retention.chunks.expires_at`, `retention.chunks.expired` | The deadline for per-chunk tracks. While they exist, you can edit pauses, rebuild the final file, and regenerate or retry a chunk |
| `retention.chunks.expires_early` | `true` means the chunks will be deleted before the result, because the order was merged into a separate file |
| `retention.chunks.reason` | `chunks_purged`: no chunks, the result is still there. `storage_expired`: no files at all. `null`: everything is available |

> [!WARNING]
> After the files are deleted, `GET /orders/{order}` still returns the paths in `result.files[]`.
> A path in the response does not mean the file exists. Check `files_expired` or
> `retention.files.expired`. For a path to a deleted file, `POST /storage/url` returns `404`.

### 404 · `storage_expired` — storage_expired — file retention period has ended

| Что произошло | Что делать |
| --- | --- |
| The order files were deleted. `POST /storage/url` for a path from `result.files[]` returns 404 `{"success": false, "message": "File not found."}`. The same name can also be the value of a field in the chunk preview response. The other value of that field is `chunks_purged`: only the fragments were deleted, and the result is still there. | `GET /orders/{order}` still shows the paths in `result.files[]` after the files are deleted. `files_expired` (and `retention.files.expired`) tells you whether they are gone, and `files_expire_at` gives the deletion date. Deleted files cannot be restored. Download the result as soon as the order is `completed`. Subtitles are stored separately, in `result.service_files[]`, and are deleted along with the other files. |

`Retry-After`: нет. Разбор: https://lumean.app/de/developers/docs/errors/storage-expired

Deleted files cannot be restored. The order record remains, but the files no longer exist. The
only way to get the result again is
[`POST /orders/{order}/retry`](/developers/docs/api/post-orders-order-retry). It works for
orders in `completed` and `result_delivered`, creates a new order with the same parameters, and
that order is billed again.

**Правильно**

Download `files[]` and `service_files[]` right after `completed`. Before downloading an old
order, check `files_expired`.

**Неправильно**

Store paths or links as permanent addresses. A link expires within an hour, files are deleted
after a week, and the path stays in the response after that.

---

- Diese Seite im Browser: https://lumean.app/de/developers/docs/guide/files
- Vollständige maschinenlesbare Referenz: https://api.lumean.app/docs/llm.md
