# Update a webhook

### URL

<mark style="color:green;">**POST**</mark> `https://api.complycube.com/v1/webhooks/:id`

Updates the specified webhook by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

### Headers

<table><thead><tr><th width="216">Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code><mark style="color:red;">*</mark></td><td>string</td><td>The content-type must always be set to <code>application/json</code>.</td></tr><tr><td><code>Authorization</code><mark style="color:red;">*</mark></td><td>string</td><td>The API <code>live</code> or <code>test</code> key.</td></tr></tbody></table>

### Path parameters

<table><thead><tr><th width="216">Name</th><th width="99">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code><mark style="color:red;">*</mark></td><td>string</td><td>The ID of the webhook.</td></tr></tbody></table>

### Body

<table><thead><tr><th width="216">Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>url</code></td><td>string</td><td>URL of the webhook.</td></tr><tr><td><code>description</code></td><td>string</td><td>An optional description of what the webhook is used for.</td></tr><tr><td><code>enabled</code></td><td>boolean</td><td>Determines whether the webhook should be active.</td></tr><tr><td><code>events</code></td><td><p>array</p><p>[string]</p></td><td>The list of event types for which the event is subscribed</td></tr></tbody></table>

### Example request

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.complycube.com/v1/webhooks/:id \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
          "description": "updated description"
        }'
```

{% endtab %}

{% tab title="Node.js" %}

```java
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const webhook = await complycube.webhook.update("WEBHOOK_ID", {
   description: "updated description"
});
```

{% endtab %}

{% tab title="Python" %}

```python
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

webhook = cc_api.webhooks.update('WEBHOOK_ID', description="updated description")
```

{% endtab %}

{% tab title="PHP" %}

```php
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$webhook = $ccapi->webhooks()->update('WEBHOOK_ID', [
    'description' => 'updated description'
]);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using ComplyCube.Net;
using ComplyCube.Net.Resources.Webhooks;

var webhookApi = new WebhookApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var update = new WebhookRequest { description = "Updated description" };

var webhook = await webhookApi.UpdateAsync("WEBHOOK_ID", update);
```

{% endtab %}
{% endtabs %}

### Example response

{% tabs %}
{% tab title="Success (200)" %}

```json
{
  "id": "5ed1712e99c81a0007b9a3d6",
  "description": "Updated description",
  "url": "https://example.com/my/webhook/endpoint",
  "enabled": true,
  "events": [
    "check.created",
    "check.completed"
  ],
  "secret": "akuPkDmpn1lFiMchfmSjsQMj0sUQ4IRH",
  "createdAt": "2020-01-29T20:31:42.375Z",
  "updatedAt": "2020-01-29T20:32:22.000Z"
}
```

{% endtab %}

{% tab title="Invalid Request (400)" %}

```json
{
    "type": "invalid_request",
    "message": "'events' should be equal to one of the allowed values:check.created, check.completed",
    "param": "type"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.complycube.com/documentation/api-reference/other-resources/webhooks/update-a-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
