Skip to content

Delete a file

client.files.delete(fileID, options?): void
DELETE/files/{file_id}

Delete a file. The file is deleted immediately and this cannot be undone through the API: it can no longer be retrieved, listed, or referenced from new generations. Where file retention is enabled for your API client, its stored bytes are then permanently deleted by a background job, not during this request, and stored bytes another live artifact still references are kept; otherwise the bytes stay stored until a Luma operator purges them. A failed file, or a file past its expires_at, can also be deleted until its stored bytes have been purged. Repeating DELETE returns 204 until the stored bytes have been purged, and 404 after that. Returns 204 with no body.

Parameters
fileID: string
format: uuid

Delete a file

import Luma from 'luma-agents';
const client = new Luma({
authToken: process.env['LUMA_AGENTS_API_KEY'], // This is the default and can be omitted
});
await client.files.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');