> ## 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 Notification Config

Use this API to update the in-app notification service configuration for a workspace. At least one of `useNotificationService` or `notificationServiceConfig` must be provided. The config is deep-merged with the existing value, so omitted sub-fields are preserved.

<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>
  The numeric delay/batching fields must be integers within these ranges, otherwise the request is rejected with `INVALID_ARGUMENT`:

  * `delayConfig.delaySeconds`: `10`–`15552000` (10 seconds to 6 months)
  * `batchConfig.document.batchWindowSeconds` / `batchConfig.user.batchWindowSeconds`: `10`–`604800` (10 seconds to 1 week)
  * `batchConfig.document.maxActivities` / `batchConfig.user.maxActivities`: `2`–`50`
</Note>

<Note>
  **Defaults on first enable.** If you enable the service (`useNotificationService: true`) and the stored config has no `triggers` yet (defaults are seeded even if `delayConfig` / `batchConfig` already exist), a default set of triggers is seeded automatically: the standard `comment` triggers and all `huddle` triggers are turned on. Delay and batching stay off — no `delayConfig` or `batchConfig` is written by the seeding. Existing non-trigger fields are preserved, and any `notificationServiceConfig` 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 `{ useNotificationService, notificationServiceConfig }` — the same shape returned by [Get Notification Config](/api-reference/rest-apis/v2/workspace/notificationconfig-get). Fields not part of your request fall back to the existing stored values.
</Note>

# Endpoint

`POST https://api.velt.dev/v2/workspace/notificationconfig/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="useNotificationService" type="boolean">
      Whether to enable the in-app notification service.
    </ParamField>

    <ParamField body="notificationServiceConfig" type="object">
      Notification service configuration object.

      <Expandable title="properties">
        <ParamField body="triggers" type="object">
          Event triggers that activate in-app notifications. Supports `comment` and `huddle` trigger groups. Each is a map of event-type string to a boolean to enable (`true`) or disable (`false`) that trigger. See [Webhooks](/webhooks/advanced) for the full list of event types.
        </ParamField>

        <ParamField body="delayConfig" type="object">
          Notification delay settings.

          <Expandable title="properties">
            <ParamField body="isEnabled" type="boolean">
              Whether delayed notifications are enabled.
            </ParamField>

            <ParamField body="delaySeconds" type="number">
              Delay before sending a notification, in seconds. Must be an integer between `10` and `15552000` (10 seconds to 6 months).
            </ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="batchConfig" type="object">
          Notification batching settings, with independent `document` and `user` configs.

          <Expandable title="properties">
            <ParamField body="document" type="object">
              Per-document batching.

              <Expandable title="properties">
                <ParamField body="isEnabled" type="boolean">
                  Whether document-level batching is enabled.
                </ParamField>

                <ParamField body="batchWindowSeconds" type="number">
                  Time window to group document-level notifications, in seconds. Must be an integer between `10` and `604800` (10 seconds to 1 week).
                </ParamField>

                <ParamField body="maxActivities" type="number">
                  Flush the batch once this many activities accumulate. Must be an integer between `2` and `50`.
                </ParamField>
              </Expandable>
            </ParamField>

            <ParamField body="user" type="object">
              Per-user batching.

              <Expandable title="properties">
                <ParamField body="isEnabled" type="boolean">
                  Whether user-level batching is enabled.
                </ParamField>

                <ParamField body="batchWindowSeconds" type="number">
                  Time window to group user-level notifications, in seconds. Must be an integer between `10` and `604800` (10 seconds to 1 week).
                </ParamField>

                <ParamField body="maxActivities" type="number">
                  Flush the batch once this many activities accumulate. Must be an integer between `2` and `50`.
                </ParamField>
              </Expandable>
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

# Example Request

```JSON theme={null}
{
  "data": {
    "useNotificationService": true,
    "notificationServiceConfig": {
      "delayConfig": {
        "isEnabled": true,
        "delaySeconds": 30
      }
    }
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Notification configuration updated successfully.",
    "data": {
      "useNotificationService": true,
      "notificationServiceConfig": {
        "delayConfig": {
          "isEnabled": true,
          "delaySeconds": 30
        }
      }
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "At least one of useNotificationService or notificationServiceConfig must be provided"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Notification configuration updated successfully.",
      "data": {
        "useNotificationService": true,
        "notificationServiceConfig": {
          "delayConfig": {
            "isEnabled": true,
            "delaySeconds": 30
          }
        }
      }
    }
  }
  ```
</ResponseExample>
