---
title: スキャングループの更新
description: ルールの順序を含め、グループを更新します。グループ内のルールは、ルール関係を含めることで順序が変更されます。ルール関係が存在する場合、そのデータセクションは、現在グループにあるすべてのルールのリンケージを含まなければならず、他のものを含んではなりません。
breadcrumbs: ドキュメント > API > スキャングループの更新
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/llms.txt).

# スキャングループの更新

## v2 (latest)

| Datadog site      | API endpoint                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------ |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/sensitive-data-scanner/config/groups/{group_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/sensitive-data-scanner/config/groups/{group_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/sensitive-data-scanner/config/groups/{group_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/sensitive-data-scanner/config/groups/{group_id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/sensitive-data-scanner/config/groups/{group_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/sensitive-data-scanner/config/groups/{group_id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/sensitive-data-scanner/config/groups/{group_id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/sensitive-data-scanner/config/groups/{group_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/sensitive-data-scanner/config/groups/{group_id}  |

### Overview

ルールの順序を含め、グループを更新します。グループ内のルールは、ルール関係を含めることで順序が変更されます。ルール関係が存在する場合、そのデータセクションは、現在グループにあるすべてのルールのリンケージを含まなければならず、他のものを含んではなりません。

This endpoint requires the `data_scanner_write` permission.

### Arguments

#### Path Parameters

| Field                 | Type   | Description                 |
| --------------------- | ------ | --------------------------- |
| group_id [*required*] | string | The ID of a group of rules. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field  | Field             | Type     | Description                                                                                                                                              |
| ------------- | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data [*required*] | object   | グループリクエストを更新します。                                                                                                                                         |
| data          | attributes        | object   | Attributes of the Sensitive Data Scanner group.                                                                                                          |
| attributes    | description       | string   | Description of the group.                                                                                                                                |
| attributes    | filter            | object   | Filter for the Scanning Group.                                                                                                                           |
| filter        | query             | string   | Query to filter the events.                                                                                                                              |
| attributes    | is_enabled        | boolean  | Whether or not the group is enabled.                                                                                                                     |
| attributes    | name              | string   | Name of the group.                                                                                                                                       |
| attributes    | product_list      | [string] | List of products the scanning group applies.                                                                                                             |
| attributes    | samplings         | [object] | List of sampling rates per product type.                                                                                                                 |
| samplings     | product           | enum     | Datadog product onto which Sensitive Data Scanner can be activated. Allowed enum values: `logs`, `rum`, `events`, `apm`. Default: `logs`.                |
| samplings     | rate              | double   | Rate at which data in product type will be scanned, as a percentage.                                                                                     |
| data          | id                | string   | ID of the group.                                                                                                                                         |
| data          | relationships     | object   | Relationships of the group.                                                                                                                              |
| relationships | configuration     | object   | A Sensitive Data Scanner configuration data.                                                                                                             |
| configuration | data              | object   | A Sensitive Data Scanner configuration.                                                                                                                  |
| data          | id                | string   | ID of the configuration.                                                                                                                                 |
| data          | type              | enum     | Sensitive Data Scanner configuration type. Allowed enum values: `sensitive_data_scanner_configuration`. Default: `sensitive_data_scanner_configuration`. |
| relationships | rules             | object   | Rules included in the group.                                                                                                                             |
| rules         | data              | [object] | Rules included in the group. The order is important.                                                                                                     |
| data          | id                | string   | ID of the rule.                                                                                                                                          |
| data          | type              | enum     | Sensitive Data Scanner rule type. Allowed enum values: `sensitive_data_scanner_rule`. Default: `sensitive_data_scanner_rule`.                            |
| data          | type              | enum     | Sensitive Data Scanner group type. Allowed enum values: `sensitive_data_scanner_group`. Default: `sensitive_data_scanner_group`.                         |
|               | meta [*required*] | object   | Meta payload containing information about the API.                                                                                                       |
| meta          | version           | int64    | Version of the API (optional).                                                                                                                           |
{% /tab %}

{% tab label="Example" %}
```json
{
  "meta": {},
  "data": {
    "id": "string",
    "type": "sensitive_data_scanner_group",
    "attributes": {
      "name": "Example-Sensitive-Data-Scanner",
      "is_enabled": false,
      "product_list": [
        "logs"
      ],
      "filter": {
        "query": "*"
      }
    },
    "relationships": {
      "configuration": {
        "data": {
          "type": "sensitive_data_scanner_configuration",
          "id": "55482444-d71c-c45c-7d1f-31984f64e6d2"
        }
      },
      "rules": {
        "data": []
      }
    }
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Update group response.

| Parent field | Field   | Type   | Description                                        |
| ------------ | ------- | ------ | -------------------------------------------------- |
|              | meta    | object | Meta payload containing information about the API. |
| meta         | version | int64  | Version of the API (optional).                     |
{% /tab %}

{% tab label="Example" %}
```json
{
  "meta": {
    "version": 0
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Authentication Error

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export group_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/sensitive-data-scanner/config/groups/${group_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "meta": {},
  "data": {
    "id": "string",
    "type": "sensitive_data_scanner_group",
    "attributes": {
      "name": "Example-Sensitive-Data-Scanner",
      "is_enabled": false,
      "product_list": [
        "logs"
      ],
      "filter": {
        "query": "*"
      }
    },
    "relationships": {
      "configuration": {
        "data": {
          "type": "sensitive_data_scanner_configuration",
          "id": "55482444-d71c-c45c-7d1f-31984f64e6d2"
        }
      },
      "rules": {
        "data": []
      }
    }
  }
}
EOF
```
{% /tab %}

{% tab label="Go" %}
```go
// Update Scanning Group returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "scanning_group" in the system
	GroupDataID := os.Getenv("GROUP_DATA_ID")

	// a valid "configuration" in the system
	ConfigurationDataID := os.Getenv("CONFIGURATION_DATA_ID")

	body := datadogV2.SensitiveDataScannerGroupUpdateRequest{
		Meta: datadogV2.SensitiveDataScannerMetaVersionOnly{},
		Data: datadogV2.SensitiveDataScannerGroupUpdate{
			Id:   datadog.PtrString(GroupDataID),
			Type: datadogV2.SENSITIVEDATASCANNERGROUPTYPE_SENSITIVE_DATA_SCANNER_GROUP.Ptr(),
			Attributes: &datadogV2.SensitiveDataScannerGroupAttributes{
				Name:      datadog.PtrString("Example-Sensitive-Data-Scanner"),
				IsEnabled: datadog.PtrBool(false),
				ProductList: []datadogV2.SensitiveDataScannerProduct{
					datadogV2.SENSITIVEDATASCANNERPRODUCT_LOGS,
				},
				Filter: &datadogV2.SensitiveDataScannerFilter{
					Query: datadog.PtrString("*"),
				},
			},
			Relationships: &datadogV2.SensitiveDataScannerGroupRelationships{
				Configuration: &datadogV2.SensitiveDataScannerConfigurationData{
					Data: &datadogV2.SensitiveDataScannerConfiguration{
						Type: datadogV2.SENSITIVEDATASCANNERCONFIGURATIONTYPE_SENSITIVE_DATA_SCANNER_CONFIGURATIONS.Ptr(),
						Id:   datadog.PtrString(ConfigurationDataID),
					},
				},
				Rules: &datadogV2.SensitiveDataScannerRuleData{
					Data: []datadogV2.SensitiveDataScannerRule{},
				},
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSensitiveDataScannerApi(apiClient)
	resp, r, err := api.UpdateScanningGroup(ctx, GroupDataID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SensitiveDataScannerApi.UpdateScanningGroup`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SensitiveDataScannerApi.UpdateScanningGroup`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Update Scanning Group returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SensitiveDataScannerApi;
import com.datadog.api.client.v2.model.SensitiveDataScannerConfiguration;
import com.datadog.api.client.v2.model.SensitiveDataScannerConfigurationData;
import com.datadog.api.client.v2.model.SensitiveDataScannerConfigurationType;
import com.datadog.api.client.v2.model.SensitiveDataScannerFilter;
import com.datadog.api.client.v2.model.SensitiveDataScannerGroupAttributes;
import com.datadog.api.client.v2.model.SensitiveDataScannerGroupRelationships;
import com.datadog.api.client.v2.model.SensitiveDataScannerGroupType;
import com.datadog.api.client.v2.model.SensitiveDataScannerGroupUpdate;
import com.datadog.api.client.v2.model.SensitiveDataScannerGroupUpdateRequest;
import com.datadog.api.client.v2.model.SensitiveDataScannerGroupUpdateResponse;
import com.datadog.api.client.v2.model.SensitiveDataScannerMetaVersionOnly;
import com.datadog.api.client.v2.model.SensitiveDataScannerProduct;
import com.datadog.api.client.v2.model.SensitiveDataScannerRuleData;
import java.util.Collections;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    SensitiveDataScannerApi apiInstance = new SensitiveDataScannerApi(defaultClient);

    // there is a valid "scanning_group" in the system
    String GROUP_DATA_ID = System.getenv("GROUP_DATA_ID");

    // a valid "configuration" in the system
    String CONFIGURATION_DATA_ID = System.getenv("CONFIGURATION_DATA_ID");

    SensitiveDataScannerGroupUpdateRequest body =
        new SensitiveDataScannerGroupUpdateRequest()
            .meta(new SensitiveDataScannerMetaVersionOnly())
            .data(
                new SensitiveDataScannerGroupUpdate()
                    .id(GROUP_DATA_ID)
                    .type(SensitiveDataScannerGroupType.SENSITIVE_DATA_SCANNER_GROUP)
                    .attributes(
                        new SensitiveDataScannerGroupAttributes()
                            .name("Example-Sensitive-Data-Scanner")
                            .isEnabled(false)
                            .productList(
                                Collections.singletonList(SensitiveDataScannerProduct.LOGS))
                            .filter(new SensitiveDataScannerFilter().query("*")))
                    .relationships(
                        new SensitiveDataScannerGroupRelationships()
                            .configuration(
                                new SensitiveDataScannerConfigurationData()
                                    .data(
                                        new SensitiveDataScannerConfiguration()
                                            .type(
                                                SensitiveDataScannerConfigurationType
                                                    .SENSITIVE_DATA_SCANNER_CONFIGURATIONS)
                                            .id(CONFIGURATION_DATA_ID)))
                            .rules(new SensitiveDataScannerRuleData())));

    try {
      SensitiveDataScannerGroupUpdateResponse result =
          apiInstance.updateScanningGroup(GROUP_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SensitiveDataScannerApi#updateScanningGroup");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Update Scanning Group returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.sensitive_data_scanner_api import SensitiveDataScannerApi
from datadog_api_client.v2.model.sensitive_data_scanner_configuration import SensitiveDataScannerConfiguration
from datadog_api_client.v2.model.sensitive_data_scanner_configuration_data import SensitiveDataScannerConfigurationData
from datadog_api_client.v2.model.sensitive_data_scanner_configuration_type import SensitiveDataScannerConfigurationType
from datadog_api_client.v2.model.sensitive_data_scanner_filter import SensitiveDataScannerFilter
from datadog_api_client.v2.model.sensitive_data_scanner_group_attributes import SensitiveDataScannerGroupAttributes
from datadog_api_client.v2.model.sensitive_data_scanner_group_relationships import (
    SensitiveDataScannerGroupRelationships,
)
from datadog_api_client.v2.model.sensitive_data_scanner_group_type import SensitiveDataScannerGroupType
from datadog_api_client.v2.model.sensitive_data_scanner_group_update import SensitiveDataScannerGroupUpdate
from datadog_api_client.v2.model.sensitive_data_scanner_group_update_request import (
    SensitiveDataScannerGroupUpdateRequest,
)
from datadog_api_client.v2.model.sensitive_data_scanner_meta_version_only import SensitiveDataScannerMetaVersionOnly
from datadog_api_client.v2.model.sensitive_data_scanner_product import SensitiveDataScannerProduct
from datadog_api_client.v2.model.sensitive_data_scanner_rule_data import SensitiveDataScannerRuleData

# there is a valid "scanning_group" in the system
GROUP_DATA_ID = environ["GROUP_DATA_ID"]

# a valid "configuration" in the system
CONFIGURATION_DATA_ID = environ["CONFIGURATION_DATA_ID"]

body = SensitiveDataScannerGroupUpdateRequest(
    meta=SensitiveDataScannerMetaVersionOnly(),
    data=SensitiveDataScannerGroupUpdate(
        id=GROUP_DATA_ID,
        type=SensitiveDataScannerGroupType.SENSITIVE_DATA_SCANNER_GROUP,
        attributes=SensitiveDataScannerGroupAttributes(
            name="Example-Sensitive-Data-Scanner",
            is_enabled=False,
            product_list=[
                SensitiveDataScannerProduct.LOGS,
            ],
            filter=SensitiveDataScannerFilter(
                query="*",
            ),
        ),
        relationships=SensitiveDataScannerGroupRelationships(
            configuration=SensitiveDataScannerConfigurationData(
                data=SensitiveDataScannerConfiguration(
                    type=SensitiveDataScannerConfigurationType.SENSITIVE_DATA_SCANNER_CONFIGURATIONS,
                    id=CONFIGURATION_DATA_ID,
                ),
            ),
            rules=SensitiveDataScannerRuleData(
                data=[],
            ),
        ),
    ),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = SensitiveDataScannerApi(api_client)
    response = api_instance.update_scanning_group(group_id=GROUP_DATA_ID, body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Update Scanning Group returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::SensitiveDataScannerAPI.new

# there is a valid "scanning_group" in the system
GROUP_DATA_ID = ENV["GROUP_DATA_ID"]

# a valid "configuration" in the system
CONFIGURATION_DATA_ID = ENV["CONFIGURATION_DATA_ID"]

body = DatadogAPIClient::V2::SensitiveDataScannerGroupUpdateRequest.new({
  meta: DatadogAPIClient::V2::SensitiveDataScannerMetaVersionOnly.new({}),
  data: DatadogAPIClient::V2::SensitiveDataScannerGroupUpdate.new({
    id: GROUP_DATA_ID,
    type: DatadogAPIClient::V2::SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP,
    attributes: DatadogAPIClient::V2::SensitiveDataScannerGroupAttributes.new({
      name: "Example-Sensitive-Data-Scanner",
      is_enabled: false,
      product_list: [
        DatadogAPIClient::V2::SensitiveDataScannerProduct::LOGS,
      ],
      filter: DatadogAPIClient::V2::SensitiveDataScannerFilter.new({
        query: "*",
      }),
    }),
    relationships: DatadogAPIClient::V2::SensitiveDataScannerGroupRelationships.new({
      configuration: DatadogAPIClient::V2::SensitiveDataScannerConfigurationData.new({
        data: DatadogAPIClient::V2::SensitiveDataScannerConfiguration.new({
          type: DatadogAPIClient::V2::SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS,
          id: CONFIGURATION_DATA_ID,
        }),
      }),
      rules: DatadogAPIClient::V2::SensitiveDataScannerRuleData.new({
        data: [],
      }),
    }),
  }),
})
p api_instance.update_scanning_group(GROUP_DATA_ID, body)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Update Scanning Group returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI;
use datadog_api_client::datadogV2::model::SensitiveDataScannerConfiguration;
use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationData;
use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationType;
use datadog_api_client::datadogV2::model::SensitiveDataScannerFilter;
use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupAttributes;
use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupRelationships;
use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupType;
use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupUpdate;
use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupUpdateRequest;
use datadog_api_client::datadogV2::model::SensitiveDataScannerMetaVersionOnly;
use datadog_api_client::datadogV2::model::SensitiveDataScannerProduct;
use datadog_api_client::datadogV2::model::SensitiveDataScannerRuleData;

#[tokio::main]
async fn main() {
    // there is a valid "scanning_group" in the system
    let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();

    // a valid "configuration" in the system
    let configuration_data_id = std::env::var("CONFIGURATION_DATA_ID").unwrap();
    let body =
        SensitiveDataScannerGroupUpdateRequest::new(
            SensitiveDataScannerGroupUpdate::new()
                .attributes(
                    SensitiveDataScannerGroupAttributes::new()
                        .filter(SensitiveDataScannerFilter::new().query("*".to_string()))
                        .is_enabled(false)
                        .name("Example-Sensitive-Data-Scanner".to_string())
                        .product_list(vec![SensitiveDataScannerProduct::LOGS]),
                )
                .id(group_data_id.clone())
                .relationships(
                    SensitiveDataScannerGroupRelationships::new()
                        .configuration(
                            SensitiveDataScannerConfigurationData
                            ::new().data(
                                SensitiveDataScannerConfiguration::new()
                                    .id(configuration_data_id.clone())
                                    .type_(
                                        SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS,
                                    ),
                            ),
                        )
                        .rules(SensitiveDataScannerRuleData::new().data(vec![])),
                )
                .type_(SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP),
            SensitiveDataScannerMetaVersionOnly::new(),
        );
    let configuration = datadog::Configuration::new();
    let api = SensitiveDataScannerAPI::with_config(configuration);
    let resp = api.update_scanning_group(group_data_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * Update Scanning Group returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.SensitiveDataScannerApi(configuration);

// there is a valid "scanning_group" in the system
const GROUP_DATA_ID = process.env.GROUP_DATA_ID as string;

// a valid "configuration" in the system
const CONFIGURATION_DATA_ID = process.env.CONFIGURATION_DATA_ID as string;

const params: v2.SensitiveDataScannerApiUpdateScanningGroupRequest = {
  body: {
    meta: {},
    data: {
      id: GROUP_DATA_ID,
      type: "sensitive_data_scanner_group",
      attributes: {
        name: "Example-Sensitive-Data-Scanner",
        isEnabled: false,
        productList: ["logs"],
        filter: {
          query: "*",
        },
      },
      relationships: {
        configuration: {
          data: {
            type: "sensitive_data_scanner_configuration",
            id: CONFIGURATION_DATA_ID,
          },
        },
        rules: {
          data: [],
        },
      },
    },
  },
  groupId: GROUP_DATA_ID,
};

apiInstance
  .updateScanningGroup(params)
  .then((data: v2.SensitiveDataScannerGroupUpdateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
