---
title: Delete a tracking opt-out
slug: campaign/api/delete-a-tracking-opt-out
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "iXgZAkvWqzyBiVOKvqruY",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout"
      }
    ],
    "name": "Delete a tracking opt-out",
    "description": "<p>Delete a tracking opt-out to reactivate the tracking of action-based data (opens and clicks) of a recipient.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "string",
          "description": "Client ID"
        }
      ],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "recipientId",
          "type": "string",
          "description": "<p>Recipient ID (usually the email address)</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "<p>The tracking opt-out was deleted.</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "406",
        "description": "<p>The tracking opt-out is not activated for this client. Ensure that the 'clientId' is correct and the required feature is enabled in the indicated client.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "dc9Ws32eYwciV2kGNGQeG",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url 'https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout?recipientId=string' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "2tkUvlLRH7vhFBWBkSBt1",
          "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}/recipients/trackingoptout?recipientId=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "N1TtoEyIYXv3bBE-KMNCj",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout?recipientId=string\")\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": "vrKgHf8hKeJvxZhJnNUJ4",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout?recipientId=string\"\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": "dc9Ws32eYwciV2kGNGQeG"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// The tracking opt-out was deleted.\n"
        },
        {
          "id": "response-1-406",
          "language": "406",
          "code": "// The tracking opt-out is not activated for this client. Ensure that the 'clientId' is correct and the required feature is enabled in the indicated client.\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}