> For a complete page index, fetch https://developer.close.com/llms.txt # Update existing Webhook subscription PUT https://api.close.com/api/v1/webhook/{id}/ Content-Type: application/json Reference: https://developer.close.com/api/resources/webhooks/update ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `id` (string, required) ### Body (application/json) This endpoint expects an UpdateWebhook. - `events` (list of WebhookSubscriptionEvent, optional, nullable) — A list of events to subscribe to. Each event has an `object_type` and an `action` from values in the [event log](https://developer.close.com/api/resources/events/list-of-event-types). You can also use [Webhook Filters](https://developer.close.com/api/resources/webhooks/webhook-filters) while creating your subscription so that an event only fires to a Webhook when certain conditions are met. - `status` (enum, optional, nullable) - Allowed values: `active`, `paused` - `url` (string, optional, nullable) — Destination URL for the webhook subscription - `verify_ssl` (boolean, optional, nullable) — Verify SSL certificate of destination webhook URL. Set to `false` to disable SSL certificate validation. We recommend using https to protect your data during delivery. ## Response ### 200 Successful response ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Types ### WebhookSubscriptionEvent - `action` (string, required) - `object_type` (string, required) - `extra_filter` (map from string to any, optional, nullable) ## Examples **Request** ```json { "status": "paused" } ``` **Response** ```json { "counters": {}, "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "date_created": "2018-12-06T19:15:09.590432", "date_updated": "2018-12-06T19:21:12.226090", "events": [ { "action": "created", "object_type": "lead" }, { "action": "updated", "object_type": "lead" }, { "action": "created", "object_type": "activity.call" }, { "action": "created", "object_type": "activity.note" }, { "action": "updated", "object_type": "activity.note" } ], "health_status": "healthy", "id": "whsub_6un6NQjYTaFdgtIZsTDXP6", "latest_error": null, "pause_reason": "api", "recent_consecutive_fail_buckets_cnt": 0, "signature_key": "058bfb6a3d8cfdc4da7c3be5901b16ae11da982b46a25fb2cd7016e97a140a1c", "status": "paused", "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "url": "https://test.example.com", "verify_ssl": true } ``` **SDK Code** ```python webhooks_update_example import requests url = "https://api.close.com/api/v1/webhook/id/" payload = { "status": "paused" } headers = { "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript webhooks_update_example const url = 'https://api.close.com/api/v1/webhook/id/'; const credentials = btoa(":"); const options = { method: 'PUT', headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'}, body: '{"status":"paused"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go webhooks_update_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/webhook/id/" payload := strings.NewReader("{\n \"status\": \"paused\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.SetBasicAuth("", "") 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 webhooks_update_example require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/webhook/id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"status\": \"paused\"\n}" response = http.request(request) puts response.read_body ``` ```java webhooks_update_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.close.com/api/v1/webhook/id/") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"status\": \"paused\"\n}") .asString(); ``` ```php webhooks_update_example request('PUT', 'https://api.close.com/api/v1/webhook/id/', [ 'body' => '{ "status": "paused" }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp webhooks_update_example using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/webhook/id/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"status\": \"paused\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ```