1 /**
2 * @oas [delete] /admin/users/{id}
3 * operationId: DeleteUsersId
4 * summary: Delete a User
5 * description: Delete a user.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: path
10 * description: The user's ID.
11 * required: true
12 * schema:
13 * type: string
14 * x-codeSamples:
15 * - lang: JavaScript
16 * label: JS SDK
17 * source: |-
18 * import Medusa from "@medusajs/js-sdk"
19 *
20 * export const sdk = new Medusa({
21 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
22 * debug: import.meta.env.DEV,
23 * auth: {
24 * type: "session",
25 * },
26 * })
27 *
28 * sdk.admin.user.delete("user_123")
29 * .then(({ deleted }) => {
30 * console.log(deleted)
31 * })
32 * - lang: Shell
33 * label: cURL
34 * source: curl -X DELETE '{backend_url}/admin/users/{id}'
35 * tags:
36 * - Users
37 * responses:
38 * "200":
39 * description: OK
40 * content:
41 * application/json:
42 * schema:
43 * $ref: "#/components/schemas/AdminUserDeleteResponse"
44 * "400":
45 * $ref: "#/components/responses/400_error"
46 * "401":
47 * $ref: "#/components/responses/unauthorized"
48 * "404":
49 * $ref: "#/components/responses/not_found_error"
50 * "409":
51 * $ref: "#/components/responses/invalid_state_error"
52 * "422":
53 * $ref: "#/components/responses/invalid_request_error"
54 * "500":
55 * $ref: "#/components/responses/500_error"
56 * x-workflow: removeUserAccountWorkflow
57 * security:
58 * - cookie_auth: []
59 * - jwt_token: []
60 * x-events:
61 * - name: user.deleted
62 * payload: |-
63 * ```ts
64 * {
65 * id, // The ID of the user
66 * }
67 * ```
68 * description: Emitted when users are deleted.
69 * deprecated: false
70 *
71 */
72