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

Use this API to update the activity logs configuration for a workspace. The `activityServiceConfig` object must contain at least one sub-field. The config is deep-merged with the existing value, so omitted sub-fields are preserved (including `enabledTime` when you omit it).

> [!NOTE]
>
> 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](https://velt.dev/docs/api-reference/rest-apis/v2/workspace/authtokens-get.md) endpoint.

> [!NOTE]
>
> **Defaults on first enable.** If you enable activity logs (`activityServiceConfig.isEnabled: true`) and no `activityServiceConfig` exists yet, defaults are seeded automatically: the standard `comment` triggers are turned on (including the `comment_annotation.suggestion_accept` / `comment_annotation.suggestion_reject` triggers, which are active by default for activity logs), `immutable` is set to `true`, and `enabledTime` is stamped with the current timestamp when you don't provide one. Any values you send in the same request (including `immutable: false` or your own `enabledTime`) are merged on top of these defaults.

> [!NOTE]
>
> The response `data` echoes the latest post-write state as `{ activityServiceConfig }` — the same shape returned by [Get Activity Config](https://velt.dev/docs/api-reference/rest-apis/v2/workspace/activityconfig-get.md), including any seeded defaults. `isEnabled` is always present (defaults to `false` when neither your request nor the stored config sets it).

# Endpoint

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

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**activityServiceConfig** `object` *required*

Activity service configuration object. Must contain at least one sub-field.

**properties**

**isEnabled** `boolean`

Whether activity logging is enabled.

**enabledTime** `number`

Timestamp (ms) when activity logging was enabled. Preserved when omitted.

**immutable** `boolean`

Whether activity logs are immutable.

**triggers** `object`

Event triggers that produce activity logs. Supports the `comment` trigger group — a map of event-type string to a boolean to enable (`true`) or disable (`false`) that trigger. See [Webhooks](https://velt.dev/docs/webhooks/advanced.md) for the full list of event types. The `comment_annotation.suggestion_accept` / `comment_annotation.suggestion_reject` triggers are active by default for activity logs — set them to `false` to stop logging suggestion accept/reject events.

# Example Request

```JSON theme={null}
{
  "data": {
    "activityServiceConfig": {
      "isEnabled": true,
      "immutable": false
    }
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity logs configuration updated successfully.",
    "data": {
      "activityServiceConfig": {
        "isEnabled": true,
        "immutable": false,
        "enabledTime": 1717520000000
      }
    }
  }
}
```

#### Failure Response

##### If activityServiceConfig has no sub-fields

```JSON theme={null}
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "At least one field must be provided for update"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Activity logs configuration updated successfully.",
    "data": {
      "activityServiceConfig": {
        "isEnabled": true,
        "immutable": false,
        "enabledTime": 1717520000000
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.