JavaScript
import Medusa from "@medusajs/js-sdk" export const sdk = new Medusa({ baseUrl: import.meta.env.VITE_BACKEND_URL || "/", debug: import.meta.env.DEV, auth: { type: "session", }, }) sdk.admin.upload.delete("test.txt") .then(({ deleted }) => { console.log(deleted) })
200
Example
{ "id": "<string>", "object": "file", "deleted": true}
Delete a file. Uses the installed file module provider to delete the file.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The file's ID.
OK
The deletion's details.
The name of the deleted object.
Whether the file was deleted.