---
title: Send a test mailing
slug: campaign/api/Hk1y-send-a-test-mailing
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "4O96hn6mMtF1FbJRkfBrr",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/test",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/test"
      }
    ],
    "name": "Send a test mailing",
    "description": "<p>Send a test mailing to check content, layout or target groups before sending the actual mailing.</p>",
    "contentType": "application/x-www-form-urlencoded",
    "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": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/vnd.optivo.broadmail.v1+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "recipientIds",
          "kind": "required",
          "type": "array",
          "description": "<p>Comma-separated list of recipient IDs from the provided recipient list (\"recipientListId\"). If a recipient is not found in the recipient list, no test mailing will be sent to this recipient.</p>",
          "example": "",
          "itemType": "string",
          "customType": "string[]",
          "itemExample": "",
          "itemDefault": ""
        },
        {
          "name": "mimeType",
          "kind": "optional",
          "type": "string",
          "description": "<p>Mime type of the mailing during sending (use empty string to use the mime type of the mailing).</p>",
          "example": "text/plain, text/html, text/multipart"
        },
        {
          "name": "subject",
          "kind": "optional",
          "type": "string",
          "description": "<p>Subject of the test mailing (if mailing has a subject).</p>"
        },
        {
          "name": "senderAddress",
          "kind": "optional",
          "type": "string",
          "description": "<p>Sender address for test mailing (if mailing has a sender address). Must not be empty if specified.</p>"
        },
        {
          "name": "recipientListId",
          "kind": "required",
          "type": "string",
          "description": "Recipient list ID of the recipient list to be used for the test mailing."
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "202",
        "description": "<p>The test message was sent successfully. The response contains a report on the recipients included in the test mailing (check \"validRecipientAddresses\" field).</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "TestMailingStartedReport",
            "schema": [
              {
                "name": "mailingId",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Mailing ID",
                "format": "int64"
              },
              {
                "name": "validRecipientAddresses",
                "kind": "optional",
                "type": "array",
                "description": "Valid recipient addresses",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "userIdsOfRecipientsWithoutValidAddresses",
                "kind": "optional",
                "type": "array",
                "description": "User IDs of recipients without valid addresses",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "blacklistedRecipientAddresses",
                "kind": "optional",
                "type": "array",
                "description": "Blacklisted recipient addresses",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "links",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "uriBuilder",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": []
                  },
                  {
                    "name": "rels",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "rel",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "params",
                    "kind": "optional",
                    "type": "map",
                    "description": "",
                    "example": "",
                    "customType": "map<string, string>",
                    "schema": []
                  },
                  {
                    "name": "title",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "uri",
                    "kind": "optional",
                    "type": "string<uri>",
                    "description": "",
                    "format": "uri"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/TestMailingStartedReport",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "At least one request parameter is not valid",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "pMA_p4MtYWdJIRTnqEDDY",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/test \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'recipientIds=array' \\\n     --data 'recipientListId=string'"
        },
        {
          "id": "3budTmKxQfdURlnlvg9J5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/x-www-form-urlencoded\");\n\nvar urlencoded = new URLSearchParams();\nurlencoded.append(\"recipientIds\", \"array\");\nurlencoded.append(\"recipientListId\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: urlencoded,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/test\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "BLttqD2H9hRHIcbyZrYH_",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/test\")\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\"] = \"application/x-www-form-urlencoded\"\nrequest.body = \"recipientIds=array&recipientListId=string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "yvkP9qYuaX_sUr-IVeeXL",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/confirmations/{confirmationMailId}/test\"\n\npayload = 'recipientIds=array&recipientListId=string'\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/x-www-form-urlencoded'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "pMA_p4MtYWdJIRTnqEDDY"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-202",
          "language": "202",
          "code": "// The test message was sent successfully. The response contains a report on the recipients included in the test mailing (check \"validRecipientAddresses\" field).\n{\n  \"mailingId\": \"\",\n  \"validRecipientAddresses\": [\n    \"\"\n  ],\n  \"userIdsOfRecipientsWithoutValidAddresses\": [\n    \"\"\n  ],\n  \"blacklistedRecipientAddresses\": [\n    \"\"\n  ],\n  \"links\": [\n    {\n      \"uriBuilder\": {},\n      \"rels\": [\n        \"\"\n      ],\n      \"rel\": \"\",\n      \"type\": \"\",\n      \"params\": \"\",\n      \"title\": \"\",\n      \"uri\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// At least one request parameter is not valid\n"
        }
      ],
      "selectedLanguageId": "response-0-202"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}