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

# Update a webhook subscription

PATCH https://api.sandbox.monite.com/v1/webhook_subscriptions/{webhook_subscription_id}
Content-Type: application/json

You can update the webhook listener URL or the event list.

Reference: https://docs.monite.com/api/webhook-subscriptions/patch-webhook-subscriptions-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.sandbox.monite.com/v1` (sandbox, default)
- `https://api.monite.com/v1` (eu_production)
- `https://us.api.monite.com/v1` (na_production)

## Request

### Path parameters

- `webhook_subscription_id` (string, required) — ID of the webhook subscription. This is the same value as the `webhook_subscription_id` you receive in webhooks.

### Headers

- `x-monite-version` (string, required)

### Body (application/json)

This endpoint expects an object.

- `event_types` (list of string, optional) — A list of [events](https://docs.monite.com/references/webhooks/index#events) to subscribe to. If set to an empty array, the subscription includes all events triggered by the specified `object_type`.
- `object_type` (enum, optional) — The [object type](https://docs.monite.com/references/webhooks/index#events) to whose events you want to subscribe. To subscribe to events from multiple object types, create a separate subscription for each object type.
  - Allowed values: `account`, `accounting_connection`, `approval`, `approval_request`, `approval_policy`, `approval_policy_process`, `batch_payment`, `comment`, `counterpart`, `counterpart_address`, `counterpart_bank_account`, `counterpart_contact_person`, `counterpart_partner_metadata`, `counterpart_tax_id`, `entity`, `entity_bank_account`, `entity_settings`, `entity_user`, `export`, `overdue_reminder`, `partner_settings`, `payable`, `payables_credit_note`, `payables_purchase_order`, `payable.line_item`, `payment`, `payment_intent`, `payment_link`, `payment_reminder`, `product`, `project`, `receivable`, `recurrence`, `role`, `tag`, `todo_task`, `workflow`, `workflow_pipeline`, `ocr_task`, `delivery_note`, `receipt`, `transaction`
- `url` (string, optional) — An HTTPS URL to which Monite will send webhooks. This URL must be accessible over the public Internet, accept POST requests, and respond with status code 200. It must be a direct URL (no redirects). The same URL can be used by multiple webhook subscriptions.

## Response

### 200

Successful Response

- `id` (string, required) — A unique URL assigned to this webhook subscription. This ID is also included in the webhook data as the `webhook_subscription_id` field.
- `event_types` (list of string, required) — [Events](https://docs.monite.com/references/webhooks/index#events) included in this webhook subscription. An empty array means the subscription includes all events triggered by the specified `object_type`.
- `object_type` (enum, required) — The object type associated with this webhook subscription.
  - Allowed values: `account`, `accounting_connection`, `approval`, `approval_request`, `approval_policy`, `approval_policy_process`, `batch_payment`, `comment`, `counterpart`, `counterpart_address`, `counterpart_bank_account`, `counterpart_contact_person`, `counterpart_partner_metadata`, `counterpart_tax_id`, `entity`, `entity_bank_account`, `entity_settings`, `entity_user`, `export`, `overdue_reminder`, `partner_settings`, `payable`, `payables_credit_note`, `payables_purchase_order`, `payable.line_item`, `payment`, `payment_intent`, `payment_link`, `payment_reminder`, `product`, `project`, `receivable`, `recurrence`, `role`, `tag`, `todo_task`, `workflow`, `workflow_pipeline`, `ocr_task`, `delivery_note`, `receipt`, `transaction`
- `status` (enum, required)
  - Allowed values: `enabled`, `disabled`
- `url` (string, required) — URL to which the webhooks are sent. The same URL can be used by multiple webhook subscriptions.

## Errors

### 401 Patch Webhook Subscriptions ID Request Unauthorized Error

The `Authorization` header is missing or contains an invalid or expired access token. See [Authentication](https://docs.monite.com/api/concepts/authentication) to learn how to authenticate API calls.

- `any`

### 404 Patch Webhook Subscriptions ID Request Not Found Error

A subscription with the specified ID was not found. Make sure you're querying the correct environment (sandbox or production).

- `any`

### 422 Patch Webhook Subscriptions ID Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 429 Patch Webhook Subscriptions ID Request Too Many Requests Error

API rate limit has been exceeded. Check the response headers for the rate limit information.

- `any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "id",
  "event_types": [
    "created",
    "onboarding_requirements.updated",
    "onboarding_requirements.status_updated"
  ],
  "object_type": "account",
  "status": "enabled",
  "url": "https://example.com/your-webhook-listener"
}
```

**SDK Code**

```python
import requests

url = "https://api.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id"

payload = {}
headers = {
    "x-monite-version": "2024-05-25",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id';
const options = {
  method: 'PATCH',
  headers: {
    'x-monite-version': '2024-05-25',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{}'
};

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.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id"

	payload := strings.NewReader("{}")

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

	req.Header.Add("x-monite-version", "2024-05-25")
	req.Header.Add("Authorization", "Bearer <token>")
	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.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id")

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

request = Net::HTTP::Patch.new(url)
request["x-monite-version"] = '2024-05-25'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id")
  .header("x-monite-version", "2024-05-25")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-monite-version' => '2024-05-25',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-monite-version", "2024-05-25");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-monite-version": "2024-05-25",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/webhook_subscriptions/webhook_subscription_id")! 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()
```