---
title: Delete attachments of a campaign message. Only applicable for campaign message of type email
slug: campaign/api/Y0sd-delete-attachments-of-a-campaign-message-only-applicable-for-campaign-message-of-type-email
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "CiBsBYqrC3uRja0J9lhMg",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/message/attachments",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/message/attachments"
      }
    ],
    "name": "Delete attachments of a campaign message. Only applicable for campaign message of type email",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "confirmationMailId",
          "type": "integer<int64>",
          "description": "Confirmation mailing ID",
          "format": "int64"
        }
      ],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "attachmentIds",
          "type": "array",
          "description": "A comma separated list of attachment ids to be deleted",
          "schema": [],
          "itemType": "integer",
          "customType": "integer[]"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "The attachments were successfully deleted from campaign message.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "<p>The \"attachmentIds\" parameter is empty, or the campaign mailing is of type FAX.</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "The campaign mailing was not found.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "405",
        "description": "The campaign message is not of type EMAIL.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "iddNjbPHg8foTYu6IV36c",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url 'https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/message/attachments?attachmentIds=array' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "bI3HUzPEOBFU4NukDgXGD",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/message/attachments?attachmentIds=array\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "5rap5ejaYz8-d6I-tnURU",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/message/attachments?attachmentIds=array\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "EMWsu9EZakc-m3y2hu28M",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/message/attachments?attachmentIds=array\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "iddNjbPHg8foTYu6IV36c"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// The attachments were successfully deleted from campaign message.\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The \"attachmentIds\" parameter is empty, or the campaign mailing is of type FAX.\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// The campaign mailing was not found.\n"
        },
        {
          "id": "response-3-405",
          "language": "405",
          "code": "// The campaign message is not of type EMAIL.\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}