---
title: Update the content of a mailing
slug: campaign/api/update-the-content-of-a-mailing
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "4E-ukpcETLs7Xm4mkYG9t",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/message/content",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/message/content"
      }
    ],
    "name": "Update the content of a mailing",
    "description": "<p>Update the content of a mailing. You can transmit plain text, html, or multipart content that consists of HTML and plain text. See Updating mailing content via REST API on Optimizely World. Note: You can only update the content of mailings created via REST API. This operation is also not suitable for confirmation mailings.</p>",
    "contentType": "multipart/form-data",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "string",
          "description": "Client ID"
        },
        {
          "kind": "required",
          "name": "transactionalMailId",
          "type": "integer<int64>",
          "description": "Transactional mail ID",
          "format": "int64"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "content",
          "kind": "optional",
          "type": "string",
          "description": "New mailing content to be uploaded"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The mailing content was updated successfully.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "The mailing content could not be updated because of a general error.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "QZbf9v4v5bo5AbZbVGo08",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/message/content \\\n     --header 'accept: application/json'"
        },
        {
          "id": "QwtlgVQ1fVH29KwSP3s_S",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"multipart/form-data\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/message/content\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "PZJdTjhFlKa5W9m6-3qOr",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/message/content\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"multipart/form-data\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ybULV7KNPSJrqT3rGgCSP",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/message/content\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'multipart/form-data'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "QZbf9v4v5bo5AbZbVGo08"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The mailing content was updated successfully.\n"
        },
        {
          "id": "response-1-409",
          "language": "409",
          "code": "// The mailing content could not be updated because of a general error.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}