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