Code Samples for the Chrome Management Security Insights API

See Chrome Management Security Insights API for information about API features.

All the requests shown below use the following variables:

  • $TOKEN - OAuth 2 token
  • $CUSTOMER - ID of the customer or literal my_customer

Check the enablement status for insights for your domain

To check the enablement status for insights for your domain, use the checkEnablementStatus method.

Request

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:checkEnablementStatus"

Response

{
  "insightsState": "INSIGHTS_ENABLED"
}

Enable insights for your domain

To enable insights for your domain, use the enable method. You can optionally configure chrome connectors for a specific set of OUs by providing targetOus. If targetOus is not set then chrome connectors are configured at the root OU.

Request

  curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "targetOus": [
      "/corp/sales",
      "/eng"
    ]
  }' \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:enable"

Response

{
  "insightsState": "INSIGHTS_ENABLED"
}

Disable insights for your domain

To disable insights for your domain, use the disable method.

Request

  curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}' \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:disable"

Response

{
  "insightsState": "INSIGHTS_DISABLED"
}