Skip to main content

Files

Stored files (v2 manager API) — recordings, prompts, backups, and other stored objects — with listing, fetching, downloading, and (bulk) deletion. Available as mgr.files / mgr.Files / mgr.files.

List & fetch

for await (const f of mgr.files.list()) console.log(f.id, f.filename);
const all = await mgr.files.listAll();
const recordings = await mgr.files.recordings();
const byType = await mgr.files.listByType("recording");
const { item } = await mgr.files.get(fileId);
const bytes = await mgr.files.download(fileId);

Convenience listers backups(), recordings(), prompts(), and listByType(type) return the files of a single category.

Delete & bulk

await mgr.files.delete(fileId);
await mgr.files.bulkDelete([id1, id2]);
const zip = await mgr.files.bulkDownload([id1, id2]); // GET, ids in the query
const zip2 = await mgr.files.bulkDownloadPost([id1, id2]); // POST, ids in the body

Reference