---
title: List Scanning Groups
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Sensitive Data Scanner
---

# List Scanning Groups{% #list-scanning-groups %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                           |
| ----------------- | ---------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/sensitive-data-scanner/config |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/sensitive-data-scanner/config |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/sensitive-data-scanner/config      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/sensitive-data-scanner/config      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/sensitive-data-scanner/config  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/sensitive-data-scanner/config     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/sensitive-data-scanner/config |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/sensitive-data-scanner/config |

### Overview

List all the Scanning groups in your organization. This endpoint requires the `data_scanner_read` permission.

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Get all groups response.

| Parent field                   | Field                             | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------ | --------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                | data                              | object          | Response data related to the scanning groups.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| data                           | attributes                        | object          | Attributes of the Sensitive Data configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| data                           | id                                | string          | ID of the configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| data                           | relationships                     | object          | Relationships of the configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| relationships                  | groups                            | object          | List of groups, ordered.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| groups                         | data                              | [object]        | List of groups. The order is important.                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| data                           | id                                | string          | ID of the group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| data                           | type                              | enum            | Sensitive Data Scanner group type. Allowed enum values: `sensitive_data_scanner_group`                                                                                                                                                                                                                                                                                                                                                                                                |
| data                           | type                              | enum            | Sensitive Data Scanner configuration type. Allowed enum values: `sensitive_data_scanner_configuration`                                                                                                                                                                                                                                                                                                                                                                                |
|                                | included                          | [ <oneOf>] | Included objects from relationships.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| included                       | Option 1                          | object          | A Scanning Rule included item.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1                       | attributes                        | object          | Attributes of the Sensitive Data Scanner rule.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                     | description                       | string          | Description of the rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| attributes                     | excluded_namespaces               | [string]        | Attributes excluded from the scan. If namespaces is provided, it has to be a sub-path of the namespaces array.                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                     | included_keyword_configuration    | object          | Object defining a set of keywords and a number of characters that help reduce noise. You can provide a list of keywords you would like to check within a defined proximity of the matching pattern. If any of the keywords are found within the proximity check, the match is kept. If none are found, the match is discarded.                                                                                                                                                        |
| included_keyword_configuration | character_count [*required*] | int64           | The number of characters behind a match detected by Sensitive Data Scanner to look for the keywords defined. `character_count` should be greater than the maximum length of a keyword defined for a rule.                                                                                                                                                                                                                                                                             |
| included_keyword_configuration | keywords [*required*]        | [string]        | Keyword list that will be checked during scanning in order to validate a match. The number of keywords in the list must be less than or equal to 30.                                                                                                                                                                                                                                                                                                                                  |
| included_keyword_configuration | use_recommended_keywords          | boolean         | Should the rule use the underlying standard pattern keyword configuration. If set to `true`, the rule must be tied to a standard pattern. If set to `false`, the specified keywords and `character_count` are applied.                                                                                                                                                                                                                                                                |
| attributes                     | is_enabled                        | boolean         | Whether or not the rule is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                     | name                              | string          | Name of the rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes                     | namespaces                        | [string]        | Attributes included in the scan. If namespaces is empty or missing, all attributes except excluded_namespaces are scanned. If both are missing the whole event is scanned.                                                                                                                                                                                                                                                                                                            |
| attributes                     | pattern                           | string          | Not included if there is a relationship to a standard pattern.                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                     | priority                          | int64           | Integer from 1 (high) to 5 (low) indicating rule issue severity.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes                     | suppressions                      | object          | Object describing the suppressions for a rule. There are three types of suppressions, `starts_with`, `ends_with`, and `exact_match`. Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.                                                                                                                                                                                                                                                    |
| suppressions                   | ends_with                         | [string]        | List of strings to use for suppression of matches ending with these strings.                                                                                                                                                                                                                                                                                                                                                                                                          |
| suppressions                   | exact_match                       | [string]        | List of strings to use for suppression of matches exactly matching these strings.                                                                                                                                                                                                                                                                                                                                                                                                     |
| suppressions                   | starts_with                       | [string]        | List of strings to use for suppression of matches starting with these strings.                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                     | tags                              | [string]        | List of tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| attributes                     | text_replacement                  | object          | Object describing how the scanned event will be replaced.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| text_replacement               | number_of_chars                   | int64           | Required if type == 'partial_replacement_from_beginning' or 'partial_replacement_from_end'. It must be > 0.                                                                                                                                                                                                                                                                                                                                                                           |
| text_replacement               | replacement_string                | string          | Required if type == 'replacement_string'.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| text_replacement               | should_save_match                 | boolean         | Only valid when type == `replacement_string`. When enabled, matches can be unmasked in logs by users with 'Data Scanner Unmask' permission. As a security best practice, avoid masking for highly-sensitive, long-lived data.                                                                                                                                                                                                                                                         |
| text_replacement               | type                              | enum            | Type of the replacement text. None means no replacement. hash means the data will be stubbed. replacement_string means that one can chose a text to replace the data. partial_replacement_from_beginning allows a user to partially replace the data from the beginning, and partial_replacement_from_end on the other hand, allows to replace data from the end. Allowed enum values: `none,hash,replacement_string,partial_replacement_from_beginning,partial_replacement_from_end` |
| Option 1                       | id                                | string          | ID of the rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 1                       | relationships                     | object          | Relationships of a scanning rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| relationships                  | group                             | object          | A scanning group data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| group                          | data                              | object          | A scanning group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| data                           | id                                | string          | ID of the group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| data                           | type                              | enum            | Sensitive Data Scanner group type. Allowed enum values: `sensitive_data_scanner_group`                                                                                                                                                                                                                                                                                                                                                                                                |
| relationships                  | standard_pattern                  | object          | A standard pattern.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| standard_pattern               | data                              | object          | Data containing the standard pattern id.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| data                           | id                                | string          | ID of the standard pattern.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| data                           | type                              | enum            | Sensitive Data Scanner standard pattern type. Allowed enum values: `sensitive_data_scanner_standard_pattern`                                                                                                                                                                                                                                                                                                                                                                          |
| Option 1                       | type                              | enum            | Sensitive Data Scanner rule type. Allowed enum values: `sensitive_data_scanner_rule`                                                                                                                                                                                                                                                                                                                                                                                                  |
| included                       | Option 2                          | object          | A Scanning Group included item.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 2                       | 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`                                                                                                                                                                                                                                                                                                                                                                        |
| samplings                      | rate                              | double          | Rate at which data in product type will be scanned, as a percentage.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Option 2                       | id                                | string          | ID of the group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 2                       | 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`                                                                                                                                                                                                                                                                                                                                                                                |
| 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`                                                                                                                                                                                                                                                                                                                                                                                                  |
| Option 2                       | type                              | enum            | Sensitive Data Scanner group type. Allowed enum values: `sensitive_data_scanner_group`                                                                                                                                                                                                                                                                                                                                                                                                |
|                                | meta                              | object          | Meta response containing information about the API.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| meta                           | count_limit                       | int64           | Maximum number of scanning rules allowed for the org.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| meta                           | group_count_limit                 | int64           | Maximum number of scanning groups allowed for the org.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| meta                           | has_highlight_enabled             | boolean         | **DEPRECATED**: (Deprecated) Whether or not scanned events are highlighted in Logs or RUM for the org.                                                                                                                                                                                                                                                                                                                                                                                |
| meta                           | has_multi_pass_enabled            | boolean         | **DEPRECATED**: (Deprecated) Whether or not scanned events have multi-pass enabled.                                                                                                                                                                                                                                                                                                                                                                                                   |
| meta                           | is_pci_compliant                  | boolean         | Whether or not the org is compliant to the payment card industry standard.                                                                                                                                                                                                                                                                                                                                                                                                            |
| meta                           | version                           | int64           | Version of the API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {},
    "id": "string",
    "relationships": {
      "groups": {
        "data": [
          {
            "id": "string",
            "type": "sensitive_data_scanner_group"
          }
        ]
      }
    },
    "type": "sensitive_data_scanner_configuration"
  },
  "included": [
    {
      "attributes": {
        "description": "string",
        "excluded_namespaces": [
          "admin.name"
        ],
        "included_keyword_configuration": {
          "character_count": 30,
          "keywords": [
            "email",
            "address",
            "login"
          ],
          "use_recommended_keywords": false
        },
        "is_enabled": false,
        "name": "string",
        "namespaces": [
          "admin"
        ],
        "pattern": "string",
        "priority": "integer",
        "suppressions": {
          "ends_with": [
            "@example.com",
            "another.example.com"
          ],
          "exact_match": [
            "admin@example.com",
            "user@example.com"
          ],
          "starts_with": [
            "admin",
            "user"
          ]
        },
        "tags": [],
        "text_replacement": {
          "number_of_chars": "integer",
          "replacement_string": "string",
          "should_save_match": false,
          "type": "string"
        }
      },
      "id": "string",
      "relationships": {
        "group": {
          "data": {
            "id": "string",
            "type": "sensitive_data_scanner_group"
          }
        },
        "standard_pattern": {
          "data": {
            "id": "string",
            "type": "sensitive_data_scanner_standard_pattern"
          }
        }
      },
      "type": "sensitive_data_scanner_rule"
    }
  ],
  "meta": {
    "count_limit": "integer",
    "group_count_limit": "integer",
    "has_highlight_enabled": false,
    "has_multi_pass_enabled": false,
    "is_pci_compliant": false,
    "version": 0
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Authentication Error
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/sensitive-data-scanner/config" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
List Scanning Groups returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.sensitive_data_scanner_api import SensitiveDataScannerApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = SensitiveDataScannerApi(api_client)
    response = api_instance.list_scanning_groups()

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# List Scanning Groups returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SensitiveDataScannerAPI.new
p api_instance.list_scanning_groups()
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// List Scanning Groups 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSensitiveDataScannerApi(apiClient)
	resp, r, err := api.ListScanningGroups(ctx)

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

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

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// List Scanning Groups 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.SensitiveDataScannerGetConfigResponse;

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

    try {
      SensitiveDataScannerGetConfigResponse result = apiInstance.listScanningGroups();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SensitiveDataScannerApi#listScanningGroups");
      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://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// List Scanning Groups returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SensitiveDataScannerAPI::with_config(configuration);
    let resp = api.list_scanning_groups().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * List Scanning Groups returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.SensitiveDataScannerApi(configuration);

apiInstance
  .listScanningGroups()
  .then((data: v2.SensitiveDataScannerGetConfigResponse) => {
    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://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
