Skip to content
Start here

Updates Security Center Insight Classification

client.SecurityCenter.Insights.Classification.Update(ctx, issueID, params) (*InsightClassificationUpdateResponse, error)
PATCH/{accounts_or_zones}/{account_or_zone_id}/security-center/insights/{issue_id}/classification

Updates the user classification for a Security Center insight. Valid values are ‘false_positive’ or ‘accept_risk’. To reset, set classification to null. Cannot change directly between classification values - must reset to null first.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
issueID string
params InsightClassificationUpdateParams
AccountID param.Field[string]Optional

Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

ZoneID param.Field[string]Optional

Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

Classification param.Field[InsightClassificationUpdateParamsClassification]Optional

Body param: User-defined classification for the insight. Can be ‘false_positive’, ‘accept_risk’, ‘other’, or null.

const InsightClassificationUpdateParamsClassificationFalsePositive InsightClassificationUpdateParamsClassification = "false_positive"
const InsightClassificationUpdateParamsClassificationAcceptRisk InsightClassificationUpdateParamsClassification = "accept_risk"
const InsightClassificationUpdateParamsClassificationOther InsightClassificationUpdateParamsClassification = "other"
Rationale param.Field[string]Optional

Body param: Rationale for the classification change. Required when classification is ‘accept_risk’ or ‘other’.

ReturnsExpand Collapse
type InsightClassificationUpdateResponse struct{…}
Errors []InsightClassificationUpdateResponseError
Code int64
minimum1000
Message string
DocumentationURL stringOptional
Source InsightClassificationUpdateResponseErrorsSourceOptional
Pointer stringOptional
Messages []InsightClassificationUpdateResponseMessage
Code int64
minimum1000
Message string
DocumentationURL stringOptional
Source InsightClassificationUpdateResponseMessagesSourceOptional
Pointer stringOptional
Success InsightClassificationUpdateResponseSuccess

Whether the API call was successful.

Updates Security Center Insight Classification

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/security_center"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  classification, err := client.SecurityCenter.Insights.Classification.Update(
    context.TODO(),
    "issue_id",
    security_center.InsightClassificationUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", classification.Errors)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true
}