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

{
  "id": "05DmdhnoHqaTGKN52Niti",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}"
      }
    ],
    "name": "Update a webhook",
    "description": "",
    "contentType": "application/x-www-form-urlencoded",
    "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": [
        {
          "name": "basicAuthUsername",
          "kind": "optional",
          "type": "string",
          "description": "<p>User name for Basic HTTP Authentication. This parameter is deprecated and might be removed in the near future. Please use &#x3C;authentication> instead.</p>"
        },
        {
          "name": "basicAuthPassword",
          "kind": "optional",
          "type": "string",
          "description": "<p>Password for Basic HTTP Authentication. This parameter is deprecated and might be removed in the near future. Please use &#x3C;authentication> instead.</p>"
        },
        {
          "name": "type",
          "kind": "required",
          "type": "string<open | click | sent | bounce | unsubscribe | spamcomplaint | singleoptin | confirmedoptin | doubleoptin | blocklist | archive | filteredbyblocklist>",
          "description": "Event data type",
          "enum": [
            "open",
            "click",
            "sent",
            "bounce",
            "unsubscribe",
            "spamcomplaint",
            "singleoptin",
            "confirmedoptin",
            "doubleoptin",
            "blocklist",
            "archive",
            "filteredbyblocklist"
          ]
        },
        {
          "name": "format",
          "kind": "required",
          "type": "string<json>",
          "description": "Data format in which the event data is to be sent",
          "enum": [
            "json"
          ]
        },
        {
          "name": "authentication",
          "kind": "optional",
          "type": "string",
          "description": "<p>Authentication method and attributes as json.\n\nCurrent types are:</p>\n<p>or</p>\n<p>or</p>"
        },
        {
          "name": "targetUrl",
          "kind": "required",
          "type": "string",
          "description": "<p>Target URL to which the event data is to be sentNote: The URL must be accessible and able to receive data via HTTP POST requests from the IP address 193.169.180.1 at any time. Use the current HTTPS version and standard port 443 for HTTPS connections.</p>"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The webhook was updated 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 \"webhookId\" cannot be updated",
        "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": "AINTOK3UvO-6MgwEzfFqJ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'type=open' \\\n     --data 'format=json' \\\n     --data 'targetUrl=string'"
        },
        {
          "id": "Zl8oQZ_LJpTna-9C4xtPe",
          "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(\"type\", \"open\");\nurlencoded.append(\"format\", \"json\");\nurlencoded.append(\"targetUrl\", \"string\");\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: urlencoded,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "gkP4gi4rDUTse0k7muWHT",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/x-www-form-urlencoded\"\nrequest.body = \"type=open&format=json&targetUrl=string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "7g4DoHU7LoYx9vb3GmK2p",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/webhooks/{webhookId}\"\n\npayload = 'type=open&format=json&targetUrl=string'\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/x-www-form-urlencoded'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "AINTOK3UvO-6MgwEzfFqJ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The webhook was updated 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 \"webhookId\" cannot be updated\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": ""
    }
  ]
}