> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.heyreach.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.heyreach.io/_mcp/server.

# Update Webhook

PATCH https://api//api/public/webhooks/UpdateWebhook?webhookId=1234
Content-Type: application/json

# Update Webhook

**Endpoint**\
`PATCH {{baseUrl}}/api/public/webhooks/UpdateWebhook?webhookId=1234`

**Description**\
This API updates an existing webhook by modifying its configuration, such as name, URL, event type, associated campaigns, and status.

***

## Query Parameters

* **`webhookId`** (`string`): The unique identifier of the webhook to update. This must be provided as a query parameter.

***

## Request Body Example

```json
{
  "webhookName": "string",
  "webhookUrl": "string",
  "eventType": "CONNECTION_REQUEST_SENT",
  "campaignIds": [],
  "isActive": true
}

```

## Request Parameters

* **`webhookName`** (`string`): The name of the webhook. If NULL or ommited, the original name will be kept.

* **`webhookUrl`** (`string`): The URL to which the webhook will send POST requests. If NULL or ommited, the orignal url will be kept

* **`eventType`** (`string`): The type of event that triggers the webhook. If null or ommited, the original will be kept.\
  It must be one of the following values:

  * `CONNECTION_REQUEST_SENT`

  * `CONNECTION_REQUEST_ACCEPTED`

  * `MESSAGE_SENT`

  * `MESSAGE_REPLY_RECEIVED`

  * `INMAIL_SENT`

  * `INMAIL_REPLY_RECEIVED`

  * `FOLLOW_SENT`

  * `LIKED_POST`

  * `VIEWED_PROFILE`

  * `CAMPAIGN_COMPLETED`

  * `LEAD_TAG_UPDATED`

* **`campaignIds`** (`array`): A list of campaign IDs.\
  If null or ommited, the original array will be kept.\
  If this array is empty, the webhook will listen for the specified `eventType` across all campaigns. If specific campaign IDs are provided, the webhook will listen only to those campaigns.

* **`isActive`** (`boolean` | `null`): Determines whether the webhook should be active. If `true`, the webhook is enabled; if `false`, it is disabled. If `null`, the activation status remains unchanged.

Reference: https://docs.heyreach.io/hey-reach-api/webhooks/update-webhook

## Request

### Query parameters

- `webhookId` (integer, optional)

### Headers

- `X-API-KEY` (string, optional) — API key header using this scheme. Example: "X-API-KEY: \{API\_KEY}"

### Body (application/json)

This endpoint expects a string.

- `string`

## Examples

**Request**

```json
"{\n  \"webhookName\": \"string\" | null,\n  \"webhookUrl\": \"string\" | null,\n  \"eventType\": \"CONNECTION_REQUEST_SENT\" | \"CONNECTION_REQUEST_ACCEPTED\" | \"MESSAGE_SENT\" | \"MESSAGE_REPLY_RECEIVED\" | \"INMAIL_SENT\" | \"INMAIL_REPLY_RECEIVED\" | \"FOLLOW_SENT\" | \"LIKED_POST\" | \"VIEWED_PROFILE\" | \"CAMPAIGN_COMPLETED\" | \"LEAD_TAG_UPDATED\" | null\n  \"campaignIds\": [] | null\n  \"isActive\": true | null\n}"
```

**SDK Code**

```python
import requests

url = "https://api//api/public/webhooks/UpdateWebhook"

querystring = {"webhookId":"1234"}

payload = "{
  \"webhookName\": \"string\" | null,
  \"webhookUrl\": \"string\" | null,
  \"eventType\": \"CONNECTION_REQUEST_SENT\" | \"CONNECTION_REQUEST_ACCEPTED\" | \"MESSAGE_SENT\" | \"MESSAGE_REPLY_RECEIVED\" | \"INMAIL_SENT\" | \"INMAIL_REPLY_RECEIVED\" | \"FOLLOW_SENT\" | \"LIKED_POST\" | \"VIEWED_PROFILE\" | \"CAMPAIGN_COMPLETED\" | \"LEAD_TAG_UPDATED\" | null
  \"campaignIds\": [] | null
  \"isActive\": true | null
}"
headers = {
    "X-API-KEY": "<string>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api//api/public/webhooks/UpdateWebhook?webhookId=1234';
const options = {
  method: 'PATCH',
  headers: {'X-API-KEY': '<string>', 'Content-Type': 'application/json'},
  body: '"{\n  \"webhookName\": \"string\" | null,\n  \"webhookUrl\": \"string\" | null,\n  \"eventType\": \"CONNECTION_REQUEST_SENT\" | \"CONNECTION_REQUEST_ACCEPTED\" | \"MESSAGE_SENT\" | \"MESSAGE_REPLY_RECEIVED\" | \"INMAIL_SENT\" | \"INMAIL_REPLY_RECEIVED\" | \"FOLLOW_SENT\" | \"LIKED_POST\" | \"VIEWED_PROFILE\" | \"CAMPAIGN_COMPLETED\" | \"LEAD_TAG_UPDATED\" | null\n  \"campaignIds\": [] | null\n  \"isActive\": true | null\n}"'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api//api/public/webhooks/UpdateWebhook?webhookId=1234"

	payload := strings.NewReader("\"{\\n  \\\"webhookName\\\": \\\"string\\\" | null,\\n  \\\"webhookUrl\\\": \\\"string\\\" | null,\\n  \\\"eventType\\\": \\\"CONNECTION_REQUEST_SENT\\\" | \\\"CONNECTION_REQUEST_ACCEPTED\\\" | \\\"MESSAGE_SENT\\\" | \\\"MESSAGE_REPLY_RECEIVED\\\" | \\\"INMAIL_SENT\\\" | \\\"INMAIL_REPLY_RECEIVED\\\" | \\\"FOLLOW_SENT\\\" | \\\"LIKED_POST\\\" | \\\"VIEWED_PROFILE\\\" | \\\"CAMPAIGN_COMPLETED\\\" | \\\"LEAD_TAG_UPDATED\\\" | null\\n  \\\"campaignIds\\\": [] | null\\n  \\\"isActive\\\": true | null\\n}\"")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-API-KEY", "<string>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api//api/public/webhooks/UpdateWebhook?webhookId=1234")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<string>'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n  \\\"webhookName\\\": \\\"string\\\" | null,\\n  \\\"webhookUrl\\\": \\\"string\\\" | null,\\n  \\\"eventType\\\": \\\"CONNECTION_REQUEST_SENT\\\" | \\\"CONNECTION_REQUEST_ACCEPTED\\\" | \\\"MESSAGE_SENT\\\" | \\\"MESSAGE_REPLY_RECEIVED\\\" | \\\"INMAIL_SENT\\\" | \\\"INMAIL_REPLY_RECEIVED\\\" | \\\"FOLLOW_SENT\\\" | \\\"LIKED_POST\\\" | \\\"VIEWED_PROFILE\\\" | \\\"CAMPAIGN_COMPLETED\\\" | \\\"LEAD_TAG_UPDATED\\\" | null\\n  \\\"campaignIds\\\": [] | null\\n  \\\"isActive\\\": true | null\\n}\""

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api//api/public/webhooks/UpdateWebhook?webhookId=1234")
  .header("X-API-KEY", "<string>")
  .header("Content-Type", "application/json")
  .body("\"{\\n  \\\"webhookName\\\": \\\"string\\\" | null,\\n  \\\"webhookUrl\\\": \\\"string\\\" | null,\\n  \\\"eventType\\\": \\\"CONNECTION_REQUEST_SENT\\\" | \\\"CONNECTION_REQUEST_ACCEPTED\\\" | \\\"MESSAGE_SENT\\\" | \\\"MESSAGE_REPLY_RECEIVED\\\" | \\\"INMAIL_SENT\\\" | \\\"INMAIL_REPLY_RECEIVED\\\" | \\\"FOLLOW_SENT\\\" | \\\"LIKED_POST\\\" | \\\"VIEWED_PROFILE\\\" | \\\"CAMPAIGN_COMPLETED\\\" | \\\"LEAD_TAG_UPDATED\\\" | null\\n  \\\"campaignIds\\\": [] | null\\n  \\\"isActive\\\": true | null\\n}\"")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api//api/public/webhooks/UpdateWebhook?webhookId=1234', [
  'body' => '"{\\n  \\"webhookName\\": \\"string\\" | null,\\n  \\"webhookUrl\\": \\"string\\" | null,\\n  \\"eventType\\": \\"CONNECTION_REQUEST_SENT\\" | \\"CONNECTION_REQUEST_ACCEPTED\\" | \\"MESSAGE_SENT\\" | \\"MESSAGE_REPLY_RECEIVED\\" | \\"INMAIL_SENT\\" | \\"INMAIL_REPLY_RECEIVED\\" | \\"FOLLOW_SENT\\" | \\"LIKED_POST\\" | \\"VIEWED_PROFILE\\" | \\"CAMPAIGN_COMPLETED\\" | \\"LEAD_TAG_UPDATED\\" | null\\n  \\"campaignIds\\": [] | null\\n  \\"isActive\\": true | null\\n}"',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<string>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/webhooks/UpdateWebhook?webhookId=1234");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-API-KEY", "<string>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\n  \\\"webhookName\\\": \\\"string\\\" | null,\\n  \\\"webhookUrl\\\": \\\"string\\\" | null,\\n  \\\"eventType\\\": \\\"CONNECTION_REQUEST_SENT\\\" | \\\"CONNECTION_REQUEST_ACCEPTED\\\" | \\\"MESSAGE_SENT\\\" | \\\"MESSAGE_REPLY_RECEIVED\\\" | \\\"INMAIL_SENT\\\" | \\\"INMAIL_REPLY_RECEIVED\\\" | \\\"FOLLOW_SENT\\\" | \\\"LIKED_POST\\\" | \\\"VIEWED_PROFILE\\\" | \\\"CAMPAIGN_COMPLETED\\\" | \\\"LEAD_TAG_UPDATED\\\" | null\\n  \\\"campaignIds\\\": [] | null\\n  \\\"isActive\\\": true | null\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<string>",
  "Content-Type": "application/json"
]
let parameters = "{
  \"webhookName\": \"string\" | null,
  \"webhookUrl\": \"string\" | null,
  \"eventType\": \"CONNECTION_REQUEST_SENT\" | \"CONNECTION_REQUEST_ACCEPTED\" | \"MESSAGE_SENT\" | \"MESSAGE_REPLY_RECEIVED\" | \"INMAIL_SENT\" | \"INMAIL_REPLY_RECEIVED\" | \"FOLLOW_SENT\" | \"LIKED_POST\" | \"VIEWED_PROFILE\" | \"CAMPAIGN_COMPLETED\" | \"LEAD_TAG_UPDATED\" | null
  \"campaignIds\": [] | null
  \"isActive\": true | null
}" as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/webhooks/UpdateWebhook?webhookId=1234")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```