> ## 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).

<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>
  **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>

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

# Endpoint

`POST https://api.velt.dev/v2/workspace/activityconfig/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="activityServiceConfig" type="object" required>
      Activity service configuration object. Must contain at least one sub-field.

      <Expandable title="properties">
        <ParamField body="isEnabled" type="boolean">
          Whether activity logging is enabled.
        </ParamField>

        <ParamField body="enabledTime" type="number">
          Timestamp (ms) when activity logging was enabled. Preserved when omitted.
        </ParamField>

        <ParamField body="immutable" type="boolean">
          Whether activity logs are immutable.
        </ParamField>

        <ParamField body="triggers" type="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](/webhooks/advanced) 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.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

# 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"
  }
}
```

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