1 /**
2 * @oas [delete] /admin/uploads/{id}
3 * operationId: DeleteUploadsId
4 * summary: Delete a File
5 * description: Delete a file. Uses the installed file module provider to delete the file.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: path
10 * description: The file's ID.
11 * required: true
12 * schema:
13 * type: string
14 * security:
15 * - api_token: []
16 * - cookie_auth: []
17 * - jwt_token: []
18 * x-codeSamples:
19 * - lang: JavaScript
20 * label: JS SDK
21 * source: |-
22 * import Medusa from "@medusajs/js-sdk"
23 *
24 * export const sdk = new Medusa({
25 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
26 * debug: import.meta.env.DEV,
27 * auth: {
28 * type: "session",
29 * },
30 * })
31 *
32 * sdk.admin.upload.delete("test.txt")
33 * .then(({ deleted }) => {
34 * console.log(deleted)
35 * })
36 * - lang: Shell
37 * label: cURL
38 * source: |-
39 * curl -X DELETE '{backend_url}/admin/uploads/{id}' \
40 * -H 'Authorization: Bearer {jwt_token}'
41 * tags:
42 * - Uploads
43 * responses:
44 * "200":
45 * description: OK
46 * content:
47 * application/json:
48 * schema:
49 * type: object
50 * description: The deletion's details.
51 * required:
52 * - id
53 * - object
54 * - deleted
55 * properties:
56 * id:
57 * type: string
58 * title: id
59 * description: The file's ID.
60 * object:
61 * type: string
62 * title: object
63 * description: The name of the deleted object.
64 * default: file
65 * deleted:
66 * type: boolean
67 * title: deleted
68 * description: Whether the file was deleted.
69 * "400":
70 * $ref: "#/components/responses/400_error"
71 * "401":
72 * $ref: "#/components/responses/unauthorized"
73 * "404":
74 * $ref: "#/components/responses/not_found_error"
75 * "409":
76 * $ref: "#/components/responses/invalid_state_error"
77 * "422":
78 * $ref: "#/components/responses/invalid_request_error"
79 * "500":
80 * $ref: "#/components/responses/500_error"
81 * x-workflow: deleteFilesWorkflow
82 * x-events: []
83 *
84 */
85