---
title: Create custom blocklist entries
slug: campaign/api/create-custom-blocklist-entries
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "rGA05YsW4lXTerZe9NfSE",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/customblacklists/{customBlacklistId}/entries",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/customblacklists/{customBlacklistId}/entries"
      }
    ],
    "name": "Create custom blocklist entries",
    "description": "",
    "contentType": "application/x-www-form-urlencoded",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "customBlacklistId",
          "type": "integer<int64>",
          "description": "Custom blocklist 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": "patterns",
          "kind": "required",
          "type": "array",
          "description": "Patterns of the custom blocklist entries",
          "example": "",
          "itemType": "string",
          "customType": "string[]",
          "itemExample": "",
          "itemDefault": ""
        },
        {
          "name": "reason",
          "kind": "optional",
          "type": "string",
          "description": "Reason for creating a custom blocklist entry"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The custom blocklist entries were created successfully.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "RestCustomBlacklistEntry[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "",
                "format": "int64"
              },
              {
                "name": "pattern",
                "kind": "optional",
                "type": "string",
                "description": "Pattern for all mailing addresses that push into a custom blocklist"
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": "Reason for adding a pattern into a custom blocklist"
              },
              {
                "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": "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/RestCustomBlacklistEntry",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "fMymAhP3YVqx72npXVfgl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/customblacklists/{customBlacklistId}/entries \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'patterns=array'"
        },
        {
          "id": "2rj1XvTvsp1Q5ZW0_fri0",
          "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(\"patterns\", \"array\");\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}/customblacklists/{customBlacklistId}/entries\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "IZDhnT3mpbnOfqx5lI5ku",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/customblacklists/{customBlacklistId}/entries\")\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 = \"patterns=array\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "lNqfZCWLqZc_tYc8g1EgF",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/customblacklists/{customBlacklistId}/entries\"\n\npayload = 'patterns=array'\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": "fMymAhP3YVqx72npXVfgl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The custom blocklist entries were created successfully.\n[\n  {\n    \"id\": \"\",\n    \"pattern\": \"\",\n    \"reason\": \"\",\n    \"created\": \"\",\n    \"modified\": \"\",\n    \"links\": [\n      {\n        \"uriBuilder\": {},\n        \"rels\": [\n          \"\"\n        ],\n        \"rel\": \"\",\n        \"type\": \"\",\n        \"params\": \"\",\n        \"title\": \"\",\n        \"uri\": \"\"\n      }\n    ]\n  }\n]"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}