---
title: Add a recipient to a recipient list. Double opt-in processes will not be overwritten by other opt-in processes (see <a href="https://support.optimizely.com/hc/en-us/articles/4413192291981#prioritization">Opt-in documentation</a>).
slug: campaign/api/add-a-recipient-to-a-recipient-list-double-opt-in-processes-will-not-be-overwritten-by-other-opt-in-processes-see-lessa-hrefhttpssupportoptimizelycomhcen-usarticles4413192291981prioritizationgreateropt-in-documentationless
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "y086hjbUqWrFuHvVKzKFY",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}"
      }
    ],
    "name": "Add a recipient to a recipient list. Double opt-in processes will not be overwritten by other opt-in processes (see <a href=\"https://support.optimizely.com/hc/en-us/articles/4413192291981#prioritization\">Opt-in documentation</a>).",
    "description": "",
    "contentType": "application/x-www-form-urlencoded",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "recipientListId",
          "type": "integer<int64>",
          "description": "Recipient list 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": "returnOptInMailId",
          "kind": "optional",
          "type": "boolean",
          "description": "<p>Retrieve the mail ID for an opt-in process of type \"double\" or \"confirmed\"</p>",
          "default": false
        },
        {
          "name": "address",
          "kind": "optional",
          "type": "string",
          "description": "Address of the recipient. Required if ID attribute differs from the address."
        },
        {
          "name": "data",
          "kind": "optional",
          "type": "string",
          "description": "<p>Recipient data. Configure \"data.[attribute]\" according to the corresponding recipient list field.Does not work with the \"Try it out\" feature.</p>"
        },
        {
          "name": "optinProcessId",
          "kind": "optional",
          "type": "integer<int64>",
          "description": "<p>ID of the opt-in process</p>",
          "format": "int64"
        },
        {
          "name": "recipientId",
          "kind": "required",
          "type": "string",
          "description": "<p>Recipient ID (usually the email address)</p>"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "The recipient was added successfully.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestRecipient",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Recipient ID"
              },
              {
                "name": "created",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Creation date",
                "format": "date-time"
              },
              {
                "name": "modified",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Modification date",
                "format": "date-time"
              },
              {
                "name": "optInMailId",
                "kind": "optional",
                "type": "string",
                "description": "<p>Mail ID in case of double/confirmed opt-in process</p>"
              },
              {
                "name": "links",
                "kind": "optional",
                "type": "array",
                "description": "Restful links",
                "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/RestRecipient",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "202",
        "description": "<p>The recipient was added successfully, but is not immediately accessible (in case of a double opt-in).</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestRecipient",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Recipient ID"
              },
              {
                "name": "created",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Creation date",
                "format": "date-time"
              },
              {
                "name": "modified",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Modification date",
                "format": "date-time"
              },
              {
                "name": "optInMailId",
                "kind": "optional",
                "type": "string",
                "description": "<p>Mail ID in case of double/confirmed opt-in process</p>"
              },
              {
                "name": "links",
                "kind": "optional",
                "type": "array",
                "description": "Restful links",
                "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/RestRecipient",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>The required parameters for the recipient's creation are not provided. Ensure that \"clientId\", \"recipientListId\" and \"recipientId\" are added to the request.</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "<p>The recipient has either been blacklisted, has exceeded the bounce limit, has unsubscribed, or exists already. Ensure that \"recipientId\" is correct and that the recipient does not meet any of the other criteria.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "qvzNPFqcZB-mclIIFtr_p",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'returnOptInMailId=boolean' \\\n     --data 'recipientId=string'"
        },
        {
          "id": "D1gZseJ2L4L2zbekPhyVr",
          "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(\"returnOptInMailId\", \"boolean\");\nurlencoded.append(\"recipientId\", \"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}/recipients/{recipientListId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "rwp_wDkWfauDaBZOg_T0l",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}\")\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 = \"returnOptInMailId=boolean&recipientId=string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "GTflUzQA7ZNdh0DA0y9Ro",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}\"\n\npayload = 'returnOptInMailId=boolean&recipientId=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": "qvzNPFqcZB-mclIIFtr_p"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// The recipient was added successfully.\n{\n  \"id\": \"\",\n  \"created\": \"\",\n  \"modified\": \"\",\n  \"optInMailId\": \"\",\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-202",
          "language": "202",
          "code": "// The recipient was added successfully, but is not immediately accessible (in case of a double opt-in).\n{\n  \"id\": \"\",\n  \"created\": \"\",\n  \"modified\": \"\",\n  \"optInMailId\": \"\",\n  \"links\": [\n    {\n      \"uriBuilder\": {},\n      \"rels\": [\n        \"\"\n      ],\n      \"rel\": \"\",\n      \"type\": \"\",\n      \"params\": \"\",\n      \"title\": \"\",\n      \"uri\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "response-2-400",
          "language": "400",
          "code": "// The required parameters for the recipient's creation are not provided. Ensure that \"clientId\", \"recipientListId\" and \"recipientId\" are added to the request.\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// The recipient has either been blacklisted, has exceeded the bounce limit, has unsubscribed, or exists already. Ensure that \"recipientId\" is correct and that the recipient does not meet any of the other criteria.\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}