---
title: Validate entity context sync credentials
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Security Monitoring
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Validate entity context sync credentials{% #validate-entity-context-sync-credentials %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/security_monitoring/configuration/integration_config/validate      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/security_monitoring/configuration/integration_config/validate      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/security_monitoring/configuration/integration_config/validate  |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate |

### Overview

Validate a set of credentials against the external entity source before creating a sync configuration. Returns a 200 status code if the credentials are valid. This endpoint requires the `integrations_read` permission.

OAuth apps require the `integrations_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#security-monitoring) to access this endpoint.



### Request

#### Body Data (required)

The credentials to validate.

{% tab title="Model" %}

| Parent field                        | Field                                  | Type          | Description                                                                                                                                               |
| ----------------------------------- | -------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                     | data [*required*]                 | object        | The credentials to validate.                                                                                                                              |
| data                                | attributes [*required*]           |  <oneOf> | The credentials to validate against the external entity source.                                                                                           |
| attributes                          | <integration_type=GOOGLE_WORKSPACE>    | object        | The Google Workspace credentials to validate against the external entity source.                                                                          |
| <integration_type=GOOGLE_WORKSPACE> | domain [*required*]               | string        | The domain associated with the external entity source.                                                                                                    |
| <integration_type=GOOGLE_WORKSPACE> | integration_type [*required*]     | enum          | The source type for a Google Workspace entity context sync. Allowed enum values: `GOOGLE_WORKSPACE`                                                       |
| <integration_type=GOOGLE_WORKSPACE> | secrets [*required*]              | object        | Credentials for a Google Workspace entity context sync.                                                                                                   |
| secrets                             | admin_email                            | string        | The admin email to impersonate for domain-wide delegation.                                                                                                |
| secrets                             | service_account_json [*required*] | object        | The Google Cloud service account JSON used to authenticate against the Google Workspace Admin SDK. Additional keys beyond those documented are preserved. |
| service_account_json                | client_email [*required*]         | string        | The service account client email.                                                                                                                         |
| service_account_json                | private_key [*required*]          | string        | The service account private key.                                                                                                                          |
| service_account_json                | project_id [*required*]           | string        | The Google Cloud project ID that owns the service account.                                                                                                |
| service_account_json                | type [*required*]                 | string        | The service account type. Must be `service_account`.                                                                                                      |
| attributes                          | <integration_type=OKTA>                | object        | The Okta credentials to validate against the external entity source.                                                                                      |
| <integration_type=OKTA>             | domain [*required*]               | string        | The domain associated with the external entity source.                                                                                                    |
| <integration_type=OKTA>             | integration_type [*required*]     | enum          | The source type for an Okta entity context sync. Allowed enum values: `OKTA`                                                                              |
| <integration_type=OKTA>             | secrets [*required*]              | object        | Credentials for an Okta entity context sync.                                                                                                              |
| secrets                             | api_token [*required*]            | string        | The Okta API token used to authenticate against the Okta API.                                                                                             |
| attributes                          | <integration_type=ENTRA_ID>            | object        | The Entra ID credentials to validate against the external entity source.                                                                                  |
| <integration_type=ENTRA_ID>         | domain [*required*]               | string        | The domain associated with the external entity source.                                                                                                    |
| <integration_type=ENTRA_ID>         | integration_type [*required*]     | enum          | The source type for an Entra ID entity context sync. Allowed enum values: `ENTRA_ID`                                                                      |
| attributes                          | <integration_type=CROWDSTRIKE>         | object        | The CrowdStrike credentials to validate against the external entity source.                                                                               |
| <integration_type=CROWDSTRIKE>      | domain [*required*]               | string        | The domain associated with the external entity source.                                                                                                    |
| <integration_type=CROWDSTRIKE>      | integration_type [*required*]     | enum          | The source type for a CrowdStrike entity context sync. Allowed enum values: `CROWDSTRIKE`                                                                 |
| <integration_type=CROWDSTRIKE>      | secrets [*required*]              | object        | Credentials for a CrowdStrike entity context sync.                                                                                                        |
| secrets                             | client_id [*required*]            | string        | The CrowdStrike API client ID.                                                                                                                            |
| secrets                             | client_secret [*required*]        | string        | The CrowdStrike API client secret.                                                                                                                        |
| attributes                          | <integration_type=SENTINELONE>         | object        | The SentinelOne credentials to validate against the external entity source.                                                                               |
| <integration_type=SENTINELONE>      | domain [*required*]               | string        | The domain associated with the external entity source.                                                                                                    |
| <integration_type=SENTINELONE>      | integration_type [*required*]     | enum          | The source type for a SentinelOne entity context sync. Allowed enum values: `SENTINELONE`                                                                 |
| <integration_type=SENTINELONE>      | secrets [*required*]              | object        | Credentials for a SentinelOne entity context sync.                                                                                                        |
| secrets                             | api_token [*required*]            | string        | The SentinelOne API token.                                                                                                                                |
| data                                | type [*required*]                 | enum          | The type of the resource. The value should always be `integration_config`. Allowed enum values: `integration_config`                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "domain": "siem-test.com",
      "integration_type": "GOOGLE_WORKSPACE",
      "secrets": {
        "admin_email": "admin@example.com",
        "service_account_json": {
          "client_email": "svc@my-project.iam.gserviceaccount.com",
          "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
          "project_id": "my-project",
          "type": "service_account"
        }
      }
    },
    "type": "integration_config"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% /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" %}
Not Authorized
{% 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

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/security_monitoring/configuration/integration_config/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "domain": "siem-test.com",
      "integration_type": "GOOGLE_WORKSPACE",
      "secrets": {
        "admin_email": "test@example.com"
      }
    },
    "type": "integration_config"
  }
}
EOF 
                
##### 

```python
"""
Validate entity context sync credentials returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
from datadog_api_client.v2.model.security_monitoring_integration_config_resource_type import (
    SecurityMonitoringIntegrationConfigResourceType,
)
from datadog_api_client.v2.model.security_monitoring_integration_config_secrets import (
    SecurityMonitoringIntegrationConfigSecrets,
)
from datadog_api_client.v2.model.security_monitoring_integration_credentials_validate_attributes import (
    SecurityMonitoringIntegrationCredentialsValidateAttributes,
)
from datadog_api_client.v2.model.security_monitoring_integration_credentials_validate_data import (
    SecurityMonitoringIntegrationCredentialsValidateData,
)
from datadog_api_client.v2.model.security_monitoring_integration_credentials_validate_request import (
    SecurityMonitoringIntegrationCredentialsValidateRequest,
)
from datadog_api_client.v2.model.security_monitoring_integration_type import SecurityMonitoringIntegrationType

body = SecurityMonitoringIntegrationCredentialsValidateRequest(
    data=SecurityMonitoringIntegrationCredentialsValidateData(
        attributes=SecurityMonitoringIntegrationCredentialsValidateAttributes(
            domain="siem-test.com",
            integration_type=SecurityMonitoringIntegrationType.GOOGLE_WORKSPACE,
            secrets=SecurityMonitoringIntegrationConfigSecrets([("admin_email", "test@example.com")]),
        ),
        type=SecurityMonitoringIntegrationConfigResourceType.INTEGRATION_CONFIG,
    ),
)

configuration = Configuration()
configuration.unstable_operations["validate_security_monitoring_integration_credentials"] = True
with ApiClient(configuration) as api_client:
    api_instance = SecurityMonitoringApi(api_client)
    api_instance.validate_security_monitoring_integration_credentials(body=body)
```

#### 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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Validate entity context sync credentials returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.validate_security_monitoring_integration_credentials".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::SecurityMonitoringIntegrationCredentialsValidateRequest.new({
  data: DatadogAPIClient::V2::SecurityMonitoringIntegrationCredentialsValidateData.new({
    attributes: DatadogAPIClient::V2::SecurityMonitoringIntegrationCredentialsValidateAttributes.new({
      domain: "siem-test.com",
      integration_type: DatadogAPIClient::V2::SecurityMonitoringIntegrationType::GOOGLE_WORKSPACE,
      secrets: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigSecrets.new({}),
    }),
    type: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigResourceType::INTEGRATION_CONFIG,
  }),
})
p api_instance.validate_security_monitoring_integration_credentials(body)
```

#### 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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Validate entity context sync credentials returns "OK" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	body := datadogV2.SecurityMonitoringIntegrationCredentialsValidateRequest{
		Data: datadogV2.SecurityMonitoringIntegrationCredentialsValidateData{
			Attributes: datadogV2.SecurityMonitoringIntegrationCredentialsValidateAttributes{
				Domain:          "siem-test.com",
				IntegrationType: datadogV2.SECURITYMONITORINGINTEGRATIONTYPE_GOOGLE_WORKSPACE,
				Secrets: map[string]interface{}{
					"admin_email": "test@example.com",
				},
			},
			Type: datadogV2.SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ValidateSecurityMonitoringIntegrationCredentials", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSecurityMonitoringApi(apiClient)
	r, err := api.ValidateSecurityMonitoringIntegrationCredentials(ctx, body)

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

#### 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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Validate entity context sync credentials returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.SecurityMonitoringIntegrationConfigResourceType;
import com.datadog.api.client.v2.model.SecurityMonitoringIntegrationCredentialsValidateAttributes;
import com.datadog.api.client.v2.model.SecurityMonitoringIntegrationCredentialsValidateData;
import com.datadog.api.client.v2.model.SecurityMonitoringIntegrationCredentialsValidateRequest;
import com.datadog.api.client.v2.model.SecurityMonitoringIntegrationType;
import java.util.Map;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled(
        "v2.validateSecurityMonitoringIntegrationCredentials", true);
    SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);

    SecurityMonitoringIntegrationCredentialsValidateRequest body =
        new SecurityMonitoringIntegrationCredentialsValidateRequest()
            .data(
                new SecurityMonitoringIntegrationCredentialsValidateData()
                    .attributes(
                        new SecurityMonitoringIntegrationCredentialsValidateAttributes()
                            .domain("siem-test.com")
                            .integrationType(SecurityMonitoringIntegrationType.GOOGLE_WORKSPACE)
                            .secrets(Map.ofEntries(Map.entry("admin_email", "test@example.com"))))
                    .type(SecurityMonitoringIntegrationConfigResourceType.INTEGRATION_CONFIG));

    try {
      apiInstance.validateSecurityMonitoringIntegrationCredentials(body);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling"
              + " SecurityMonitoringApi#validateSecurityMonitoringIntegrationCredentials");
      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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Validate entity context sync credentials returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
use datadog_api_client::datadogV2::model::SecurityMonitoringIntegrationConfigResourceType;
use datadog_api_client::datadogV2::model::SecurityMonitoringIntegrationCredentialsValidateAttributes;
use datadog_api_client::datadogV2::model::SecurityMonitoringIntegrationCredentialsValidateData;
use datadog_api_client::datadogV2::model::SecurityMonitoringIntegrationCredentialsValidateRequest;
use datadog_api_client::datadogV2::model::SecurityMonitoringIntegrationType;
use serde_json::Value;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body = SecurityMonitoringIntegrationCredentialsValidateRequest::new(
        SecurityMonitoringIntegrationCredentialsValidateData::new(
            SecurityMonitoringIntegrationCredentialsValidateAttributes::new(
                "siem-test.com".to_string(),
                SecurityMonitoringIntegrationType::GOOGLE_WORKSPACE,
                BTreeMap::from([("admin_email".to_string(), Value::from("test@example.com"))]),
            ),
            SecurityMonitoringIntegrationConfigResourceType::INTEGRATION_CONFIG,
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled(
        "v2.ValidateSecurityMonitoringIntegrationCredentials",
        true,
    );
    let api = SecurityMonitoringAPI::with_config(configuration);
    let resp = api
        .validate_security_monitoring_integration_credentials(body)
        .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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Validate entity context sync credentials returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations[
  "v2.validateSecurityMonitoringIntegrationCredentials"
] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiValidateSecurityMonitoringIntegrationCredentialsRequest =
  {
    body: {
      data: {
        attributes: {
          domain: "siem-test.com",
          integrationType: "GOOGLE_WORKSPACE",
          secrets: {
            admin_email: "test@example.com",
          },
        },
        type: "integration_config",
      },
    },
  };

apiInstance
  .validateSecurityMonitoringIntegrationCredentials(params)
  .then((data: any) => {
    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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
