Skip to content
Start here

Change email classification

client.EmailSecurity.Investigate.Reclassify.New(ctx, postfixID, params) (*InvestigateReclassifyNewResponse, error)
POST/accounts/{account_id}/email-security/investigate/{postfix_id}/reclassify

Submits an email message for reclassification, updating its threat assessment based on new analysis.

Security

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
Accepted Permissions (at least one required)
Cloud Email Security: Write
ParametersExpand Collapse
postfixID string

The identifier of the message.

params InvestigateReclassifyNewParams
AccountID param.Field[string]

Path param: Account Identifier

maxLength32
minLength32
ExpectedDisposition param.Field[InvestigateReclassifyNewParamsExpectedDisposition]

Body param

const InvestigateReclassifyNewParamsExpectedDispositionNone InvestigateReclassifyNewParamsExpectedDisposition = "NONE"
const InvestigateReclassifyNewParamsExpectedDispositionBulk InvestigateReclassifyNewParamsExpectedDisposition = "BULK"
const InvestigateReclassifyNewParamsExpectedDispositionMalicious InvestigateReclassifyNewParamsExpectedDisposition = "MALICIOUS"
const InvestigateReclassifyNewParamsExpectedDispositionSpam InvestigateReclassifyNewParamsExpectedDisposition = "SPAM"
const InvestigateReclassifyNewParamsExpectedDispositionSpoof InvestigateReclassifyNewParamsExpectedDisposition = "SPOOF"
const InvestigateReclassifyNewParamsExpectedDispositionSuspicious InvestigateReclassifyNewParamsExpectedDisposition = "SUSPICIOUS"
EmlContent param.Field[string]optional

Body param: Base64 encoded content of the EML file

EscalatedSubmissionID param.Field[string]optional

Body param

ReturnsExpand Collapse
type InvestigateReclassifyNewResponse interface{…}

Change email classification

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/email_security"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  reclassify, err := client.EmailSecurity.Investigate.Reclassify.New(
    context.TODO(),
    "4Njp3P0STMz2c02Q",
    email_security.InvestigateReclassifyNewParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      ExpectedDisposition: cloudflare.F(email_security.InvestigateReclassifyNewParamsExpectedDispositionNone),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", reclassify)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {},
  "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"
      }
    }
  ],
  "result": {},
  "success": true
}