---
title: Send a transactional mail
slug: campaign/api/send-a-transactional-mail
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "_f_72gTCkMo2TpnZ2qZQq",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send"
      }
    ],
    "name": "Send a transactional mail",
    "description": "Send a transactional mail. You can specify attachment token or recipient data.",
    "contentType": "application/x-www-form-urlencoded",
    "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": [
        {
          "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": "personalizedAttachmentsToken",
          "kind": "optional",
          "type": "string",
          "description": "Token of the attachment to be sent"
        },
        {
          "name": "data",
          "kind": "optional",
          "type": "string",
          "description": "<p>Recipient data. Configure \"data.[attribute]\" according to the corresponding recipient list field. \nExample:\n data.firstname: John\ndata.lastname: Smith\ndata.email: <a href=\"mailto:smith@example.com\" target=\"_blank\">smith@example.com</a> (only required if the email list field is not the address field)\nDoes not work with the \"Try it out\" feature.</p>"
        },
        {
          "name": "recipientId",
          "kind": "required",
          "type": "string",
          "description": "<p>Email address or telephone number (for SMS). In case the id field is the address field in the recipient list the recipientId is sufficient. If not you have to provide the address in the request body.</p>"
        },
        {
          "name": "recipientListId",
          "kind": "required",
          "type": "integer<int64>",
          "description": "Transactional recipient list to which the recipient will be added",
          "format": "int64"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "202",
        "description": "<p>The transactional mail was accepted and is sent asynchronously. To retrieve the sending status of the transactional mail, use the returned mailId and the GET status operation.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestMailId",
            "schema": [
              {
                "name": "mailId",
                "kind": "optional",
                "type": "string",
                "description": "Encoded mail ID"
              }
            ],
            "modelRef": "#/components/schemas/RestMailId",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>The required recipientId/recipientListId is not provided and the recipient list is not assigned to the mailing. Add the required parameters and try again.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "fnSRbtNmi5W-icaPJx4EY",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'recipientId=string' \\\n     --data 'recipientListId=integer<int64>'"
        },
        {
          "id": "q24gMDtwCKxgtkRKWah6m",
          "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(\"recipientId\", \"string\");\nurlencoded.append(\"recipientListId\", \"integer<int64>\");\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}/transactionalmail/{transactionalMailId}/send\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "pH0Fu50W8c5zyv5eywUb2",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send\")\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 = \"recipientId=string&recipientListId=integer%3Cint64%3E\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ZOTMNyKrTQUu-mtuOadVv",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send\"\n\npayload = 'recipientId=string&recipientListId=integer%3Cint64%3E'\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": "fnSRbtNmi5W-icaPJx4EY"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-202",
          "language": "202",
          "code": "// The transactional mail was accepted and is sent asynchronously. To retrieve the sending status of the transactional mail, use the returned mailId and the GET status operation.\n{\n  \"mailId\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The required recipientId/recipientListId is not provided and the recipient list is not assigned to the mailing. Add the required parameters and try again.\n"
        }
      ],
      "selectedLanguageId": "response-0-202"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}