Skip to content
Start here

Submit an abuse report

client.AbuseReports.New(ctx, reportParam, params) (*string, error)
POST/accounts/{account_id}/abuse-reports/{report_param}

Submit the Abuse Report of a particular type

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
reportParam string

The report type for submitted reports.

params AbuseReportNewParams
AccountID param.Field[string]

Path param: Cloudflare Account ID

maxLength32

Body param: The report type for submitted reports.

const AbuseReportNewParamsAbuseReportsDmcaReportActAbuseDmca AbuseReportNewParamsAbuseReportsDmcaReportAct = "abuse_dmca"
Address1 param.Field[string]

Body param: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength100
minLength1
AgentName param.Field[string]

Body param: The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength60
minLength1

Body param: Can be 0 for false or 1 for true. Must be value: 1 for DMCA reports

const AbuseReportNewParamsAbuseReportsDmcaReportAgree1 AbuseReportNewParamsAbuseReportsDmcaReportAgree = 1
City param.Field[string]

Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength255
minLength1
Country param.Field[string]

Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength255
minLength1
Email param.Field[string]

Body param: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

Email2 param.Field[string]

Body param: Should match the value provided in email

Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.

const AbuseReportNewParamsAbuseReportsDmcaReportHostNotificationSend AbuseReportNewParamsAbuseReportsDmcaReportHostNotification = "send"
Name param.Field[string]

Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength255
minLength1
OriginalWork param.Field[string]

Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength255
minLength1

Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.

const AbuseReportNewParamsAbuseReportsDmcaReportOwnerNotificationSend AbuseReportNewParamsAbuseReportsDmcaReportOwnerNotification = "send"
Signature param.Field[string]

Body param: Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports

State param.Field[string]

Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength255
minLength1
URLs param.Field[string]

Body param: A list of valid URLs separated by ā€˜\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

Comments param.Field[string]optional

Body param: Any additional comments about the infringement not exceeding 2000 characters

maxLength2000
minLength1
Company param.Field[string]optional

Body param: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength100
minLength1
ReportedCountry param.Field[string]optional

Body param: Text containing 2 characters

maxLength2
minLength2
ReportedUserAgent param.Field[string]optional

Body param: Text not exceeding 255 characters

maxLength255
minLength1
Tele param.Field[string]optional

Body param: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).

maxLength20
minLength1
Title param.Field[string]optional

Body param: Text not exceeding 255 characters

maxLength255
minLength1
ReturnsExpand Collapse
type AbuseReportNewResponseEnvelopeResult string

The result should be 'success' for successful response

Submit an abuse report

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  abuseReport, err := client.AbuseReports.New(
    context.TODO(),
    "report_param",
    abuse_reports.AbuseReportNewParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      Body: abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReport{
        Act: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportActAbuseDmca),
        Address1: cloudflare.F("x"),
        AgentName: cloudflare.F("x"),
        Agree: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportAgree1),
        City: cloudflare.F("x"),
        Country: cloudflare.F("x"),
        Email: cloudflare.F("email"),
        Email2: cloudflare.F("email2"),
        HostNotification: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportHostNotificationSend),
        Name: cloudflare.F("x"),
        OriginalWork: cloudflare.F("x"),
        OwnerNotification: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportOwnerNotificationSend),
        Signature: cloudflare.F("signature"),
        State: cloudflare.F("x"),
        URLs: cloudflare.F("urls"),
      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", abuseReport)
}
{
  "abuse_rand": "abuse_rand",
  "request": {
    "act": "act"
  },
  "result": "result"
}
Returns Examples
{
  "abuse_rand": "abuse_rand",
  "request": {
    "act": "act"
  },
  "result": "result"
}