> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Webhook Config

Use this API to update the webhook service configuration for a workspace. At least one of `useWebhookService` or `webhookServiceConfig` must be provided.

<Info>
  This endpoint uses **API-key-level auth**: pass `x-velt-api-key` and `x-velt-auth-token` as headers. You can obtain these from the [Get Auth Tokens](/api-reference/rest-apis/v2/workspace/authtokens-get) endpoint.
</Info>

<Note>
  Currently only supported for Basic Webhooks.
</Note>

<Note>
  **Defaults on first enable.** If you enable the service (`useWebhookService: true`) and the stored config has no `triggers` yet (defaults are seeded even if `authToken` / URLs already exist), defaults are seeded automatically: the standard `comment` triggers and all `huddle` triggers are turned on, the `crdt` and `recorder` triggers are off, and `enableDataProtection` is `false`. The opt-in `suggestion_accept` / `suggestion_reject` comment triggers stay off until you enable them explicitly. Existing non-trigger fields are preserved, and any `webhookServiceConfig` values you send in the same request are merged on top of these defaults.
</Note>

<Note>
  The response `data` echoes the latest post-write state as `{ useWebhookService, webhookServiceConfig }` — the same shape returned by [Get Webhook Config](/api-reference/rest-apis/v2/workspace/webhookconfig-get). Fields not part of your request fall back to the existing stored values.
</Note>

# Endpoint

`POST https://api.velt.dev/v2/workspace/webhookconfig/update`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="useWebhookService" type="boolean">
      Whether to enable the webhook service.
    </ParamField>

    <ParamField body="webhookServiceConfig" type="object">
      Webhook service configuration object.

      <Expandable title="properties">
        <ParamField body="authToken" type="string">
          Auth token sent with each webhook request for verification.
        </ParamField>

        <ParamField body="rawNotificationUrl" type="string">
          URL to receive raw (unprocessed) webhook notifications.
        </ParamField>

        <ParamField body="processedNotificationUrl" type="string">
          URL to receive processed webhook notifications.
        </ParamField>

        <ParamField body="encodeData" type="boolean">
          Whether to base64 encode the webhook payload.
        </ParamField>

        <ParamField body="encryptData" type="boolean">
          Whether to encrypt the webhook payload.
        </ParamField>

        <ParamField body="publicKey" type="string">
          Public key used for payload encryption.
        </ParamField>

        <ParamField body="triggers" type="object">
          Event triggers that activate webhook notifications. Each key is an event type string and the value is a boolean to enable (`true`) or disable (`false`) that trigger. See [Webhooks](/webhooks/advanced) for the full list of event types. Common keys include:

          <Expandable title="properties">
            <ParamField body="comment_annotation.add" type="boolean">
              Trigger when a new comment thread is created.
            </ParamField>

            <ParamField body="comment.add" type="boolean">
              Trigger when a new comment is added to a thread.
            </ParamField>

            <ParamField body="comment.update" type="boolean">
              Trigger when a comment is updated.
            </ParamField>

            <ParamField body="comment.delete" type="boolean">
              Trigger when a comment is deleted.
            </ParamField>

            <ParamField body="comment_annotation.status_change" type="boolean">
              Trigger when a thread's status changes (e.g., resolved).
            </ParamField>

            <ParamField body="comment_annotation.assign" type="boolean">
              Trigger when a thread is assigned to a user.
            </ParamField>

            <ParamField body="comment_annotation.priority_change" type="boolean">
              Trigger when a thread's priority changes.
            </ParamField>

            <ParamField body="comment_annotation.suggestion_accept" type="boolean">
              Trigger when a suggestion is accepted. Opt-in: disabled by default, enable it explicitly to receive this event.
            </ParamField>

            <ParamField body="comment_annotation.suggestion_reject" type="boolean">
              Trigger when a suggestion is rejected. Opt-in: disabled by default, enable it explicitly to receive this event.
            </ParamField>

            <ParamField body="comment.reaction_add" type="boolean">
              Trigger when a reaction is added to a comment.
            </ParamField>

            <ParamField body="comment.reaction_delete" type="boolean">
              Trigger when a reaction is removed from a comment.
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

# Example Request

```JSON theme={null}
{
  "data": {
    "useWebhookService": true,
    "webhookServiceConfig": {
      "authToken": "webhook_auth_token_here",
      "rawNotificationUrl": "https://example.com/webhooks/raw",
      "processedNotificationUrl": "https://example.com/webhooks/processed"
    }
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Webhook configuration updated successfully.",
    "data": {
      "useWebhookService": true,
      "webhookServiceConfig": {
        "authToken": "webhook_auth_token_here",
        "rawNotificationUrl": "https://example.com/webhooks/raw",
        "processedNotificationUrl": "https://example.com/webhooks/processed"
      }
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "Invalid webhook service configuration."
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Webhook configuration updated successfully.",
      "data": {
        "useWebhookService": true,
        "webhookServiceConfig": {
          "authToken": "webhook_auth_token_here",
          "rawNotificationUrl": "https://example.com/webhooks/raw",
          "processedNotificationUrl": "https://example.com/webhooks/processed"
        }
      }
    }
  }
  ```
</ResponseExample>
