---
title: Deactivate a webhook
slug: campaign/api/deactivate-a-webhook
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "WYTaOVVHkDiBC2Ru8Nisy",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate"
      }
    ],
    "name": "Deactivate a webhook",
    "description": "Deactivate a webhook to stop sending event data.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "webhookId",
          "type": "integer<int64>",
          "description": "Webhook 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": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The webhook was deactivated successfully.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestWebhook",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Webhook ID",
                "format": "int64"
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string<open | click | sent | bounce | unsubscribe | spamcomplaint | webhooknode | singleoptin | confirmedoptin | doubleoptin | blocklist | archived | filteredbyblocklist>",
                "description": "Type of the event data",
                "enum": [
                  "open",
                  "click",
                  "sent",
                  "bounce",
                  "unsubscribe",
                  "spamcomplaint",
                  "webhooknode",
                  "singleoptin",
                  "confirmedoptin",
                  "doubleoptin",
                  "blocklist",
                  "archived",
                  "filteredbyblocklist"
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<created | activated | deactivated | deleted | suspended>",
                "description": "Webhook status",
                "enum": [
                  "created",
                  "activated",
                  "deactivated",
                  "deleted",
                  "suspended"
                ]
              },
              {
                "name": "format",
                "kind": "optional",
                "type": "string<json>",
                "description": "Data format of the event data",
                "enum": [
                  "json"
                ]
              },
              {
                "name": "targetUrl",
                "kind": "optional",
                "type": "string",
                "description": "Target URL"
              },
              {
                "name": "authentication",
                "kind": "optional",
                "type": "object",
                "discriminator": {
                  "propertyName": "type"
                },
                "description": "Authentication method and attributes",
                "modelRef": "#/components/schemas/WebhookAuthentication",
                "customType": "WebhookAuthentication",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  }
                ]
              },
              {
                "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"
              }
            ],
            "modelRef": "#/components/schemas/RestWebhook",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The webhook is not in status \"activated\".",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "The webhook could not be found. Ensure that the required parameters such as \"webhookId\" are correct and the webhook exists.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "The webhook ID is not assigned to the current client.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "eROwWxYO0XKQIYWAKKfQQ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate \\\n     --header 'accept: application/json'"
        },
        {
          "id": "BBalqoIkcD_dcTEX6zX9U",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "gdscKPKd_2rB2yYl5k1d6",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate\")\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/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "sX7UN1DqimacagrWObQwh",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}/deactivate\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "eROwWxYO0XKQIYWAKKfQQ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The webhook was deactivated successfully.\n{\n  \"id\": \"\",\n  \"type\": \"\",\n  \"status\": \"\",\n  \"format\": \"\",\n  \"targetUrl\": \"\",\n  \"authentication\": {\n    \"type\": \"\"\n  },\n  \"created\": \"\",\n  \"modified\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The webhook is not in status \"activated\".\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// The webhook could not be found. Ensure that the required parameters such as \"webhookId\" are correct and the webhook exists.\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// The webhook ID is not assigned to the current client.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}