# Abuse Reports ## Submit an abuse report `abuse_reports.create(strreport_param, AbuseReportCreateParams**kwargs) -> AbuseReportCreateResponse` **post** `/accounts/{account_id}/abuse-reports/{report_param}` Submit the Abuse Report of a particular type ### Parameters - `account_id: str` - `report_param: str` The report type for submitted reports. - `act: Literal["abuse_dmca"]` The report type for submitted reports. - `"abuse_dmca"` - `address1: str` Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `agent_name: str` 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/). - `agree: Literal[1]` Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - `1` - `city: str` Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `country: str` Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `email: str` 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: str` Should match the value provided in `email` - `host_notification: Literal["send"]` Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - `"send"` - `name: str` Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `original_work: str` Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `owner_notification: Literal["send"]` Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - `"send"` - `signature: str` 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: str` Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `urls: str` 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: Optional[str]` Any additional comments about the infringement not exceeding 2000 characters - `company: Optional[str]` Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `reported_country: Optional[str]` Text containing 2 characters - `reported_user_agent: Optional[str]` Text not exceeding 255 characters - `tele: Optional[str]` Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - `title: Optional[str]` Text not exceeding 255 characters ### Returns - `str` The result should be 'success' for successful response ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) abuse_report = client.abuse_reports.create( report_param="report_param", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", address1="x", agent_name="x", agree=1, city="x", country="x", email="email", email2="email2", host_notification="send", name="x", original_work="x", owner_notification="send", signature="signature", state="x", urls="urls", ) print(abuse_report) ``` #### Response ```json { "abuse_rand": "abuse_rand", "request": { "act": "act" }, "result": "result" } ``` ## Abuse Report Details `abuse_reports.get(strreport_param, AbuseReportGetParams**kwargs) -> AbuseReportGetResponse` **get** `/accounts/{account_id}/abuse-reports/{report_param}` Retrieve the details of an abuse report. ### Parameters - `account_id: str` - `report_param: str` ### Returns - `class AbuseReportGetResponse: …` - `id: str` Public facing ID of abuse report, aka abuse_rand. - `cdate: str` Creation date of report. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `domain: str` Domain that relates to the report. - `mitigation_summary: MitigationSummary` A summary of the mitigations related to this report. - `accepted_url_count: int` How many of the reported URLs were confirmed as abusive. - `active_count: int` How many mitigations are active. - `external_host_notified: bool` Whether the report has been forwarded to an external hosting provider. - `in_review_count: int` How many mitigations are under review. - `pending_count: int` How many mitigations are pending their effective date. - `status: Literal["accepted", "in_review"]` An enum value that represents the status of an abuse record - `"accepted"` - `"in_review"` - `type: Literal["PHISH", "GEN", "THREAT", 6 more]` The abuse report type - `"PHISH"` - `"GEN"` - `"THREAT"` - `"DMCA"` - `"EMER"` - `"TM"` - `"REG_WHO"` - `"NCSEI"` - `"NETWORK"` - `justification: Optional[str]` Justification for the report. - `original_work: Optional[str]` Original work / Targeted brand in the alleged abuse. - `submitter: Optional[Submitter]` Information about the submitter of the report. - `company: Optional[str]` - `email: Optional[str]` - `name: Optional[str]` - `telephone: Optional[str]` - `urls: Optional[List[str]]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) abuse_report = client.abuse_reports.get( report_param="report_param", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(abuse_report.id) ``` #### Response ```json { "result": { "id": "id", "cdate": "2009-11-10T23:00:00Z", "domain": "domain", "mitigation_summary": { "accepted_url_count": 0, "active_count": 0, "external_host_notified": true, "in_review_count": 0, "pending_count": 0 }, "status": "accepted", "type": "PHISH", "justification": "justification", "original_work": "original_work", "submitter": { "company": "company", "email": "email", "name": "name", "telephone": "telephone" }, "urls": [ "string" ] }, "success": true, "errors": [ { "message": "message", "code": "string" } ], "messages": [ { "message": "message" } ] } ``` ## List abuse reports `abuse_reports.list(AbuseReportListParams**kwargs) -> SyncV4PagePagination[Optional[AbuseReportListResponse]]` **get** `/accounts/{account_id}/abuse-reports` List the abuse reports for a given account ### Parameters - `account_id: str` - `created_after: Optional[str]` Returns reports created after the specified date - `created_before: Optional[str]` Returns reports created before the specified date - `domain: Optional[str]` Filter by domain name related to the abuse report - `mitigation_status: Optional[Literal["pending", "active", "in_review", 2 more]]` Filter reports that have any mitigations in the given status. - `"pending"` - `"active"` - `"in_review"` - `"cancelled"` - `"removed"` - `page: Optional[int]` Where in pagination to start listing abuse reports - `per_page: Optional[int]` How many abuse reports per page to list - `sort: Optional[str]` A property to sort by, followed by the order (id, cdate, domain, type, status) - `status: Optional[Literal["accepted", "in_review"]]` Filter by the status of the report. - `"accepted"` - `"in_review"` - `type: Optional[Literal["PHISH", "GEN", "THREAT", 6 more]]` Filter by the type of the report. - `"PHISH"` - `"GEN"` - `"THREAT"` - `"DMCA"` - `"EMER"` - `"TM"` - `"REG_WHO"` - `"NCSEI"` - `"NETWORK"` ### Returns - `class AbuseReportListResponse: …` - `reports: List[Report]` - `id: str` Public facing ID of abuse report, aka abuse_rand. - `cdate: str` Creation date of report. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `domain: str` Domain that relates to the report. - `mitigation_summary: ReportMitigationSummary` A summary of the mitigations related to this report. - `accepted_url_count: int` How many of the reported URLs were confirmed as abusive. - `active_count: int` How many mitigations are active. - `external_host_notified: bool` Whether the report has been forwarded to an external hosting provider. - `in_review_count: int` How many mitigations are under review. - `pending_count: int` How many mitigations are pending their effective date. - `status: Literal["accepted", "in_review"]` An enum value that represents the status of an abuse record - `"accepted"` - `"in_review"` - `type: Literal["PHISH", "GEN", "THREAT", 6 more]` The abuse report type - `"PHISH"` - `"GEN"` - `"THREAT"` - `"DMCA"` - `"EMER"` - `"TM"` - `"REG_WHO"` - `"NCSEI"` - `"NETWORK"` - `justification: Optional[str]` Justification for the report. - `original_work: Optional[str]` Original work / Targeted brand in the alleged abuse. - `submitter: Optional[ReportSubmitter]` Information about the submitter of the report. - `company: Optional[str]` - `email: Optional[str]` - `name: Optional[str]` - `telephone: Optional[str]` - `urls: Optional[List[str]]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.abuse_reports.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result.items[0] print(page.reports) ``` #### Response ```json { "success": true, "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "reports": [ { "id": "id", "cdate": "2009-11-10T23:00:00Z", "domain": "domain", "mitigation_summary": { "accepted_url_count": 0, "active_count": 0, "external_host_notified": true, "in_review_count": 0, "pending_count": 0 }, "status": "accepted", "type": "PHISH", "justification": "justification", "original_work": "original_work", "submitter": { "company": "company", "email": "email", "name": "name", "telephone": "telephone" }, "urls": [ "string" ] } ] }, "result_info": { "count": 0, "page": 0, "per_page": 0, "total_count": 0, "total_pages": 0 } } ``` ## Domain Types ### Abuse Report Create Response - `str` The result should be 'success' for successful response ### Abuse Report Get Response - `class AbuseReportGetResponse: …` - `id: str` Public facing ID of abuse report, aka abuse_rand. - `cdate: str` Creation date of report. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `domain: str` Domain that relates to the report. - `mitigation_summary: MitigationSummary` A summary of the mitigations related to this report. - `accepted_url_count: int` How many of the reported URLs were confirmed as abusive. - `active_count: int` How many mitigations are active. - `external_host_notified: bool` Whether the report has been forwarded to an external hosting provider. - `in_review_count: int` How many mitigations are under review. - `pending_count: int` How many mitigations are pending their effective date. - `status: Literal["accepted", "in_review"]` An enum value that represents the status of an abuse record - `"accepted"` - `"in_review"` - `type: Literal["PHISH", "GEN", "THREAT", 6 more]` The abuse report type - `"PHISH"` - `"GEN"` - `"THREAT"` - `"DMCA"` - `"EMER"` - `"TM"` - `"REG_WHO"` - `"NCSEI"` - `"NETWORK"` - `justification: Optional[str]` Justification for the report. - `original_work: Optional[str]` Original work / Targeted brand in the alleged abuse. - `submitter: Optional[Submitter]` Information about the submitter of the report. - `company: Optional[str]` - `email: Optional[str]` - `name: Optional[str]` - `telephone: Optional[str]` - `urls: Optional[List[str]]` ### Abuse Report List Response - `class AbuseReportListResponse: …` - `reports: List[Report]` - `id: str` Public facing ID of abuse report, aka abuse_rand. - `cdate: str` Creation date of report. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `domain: str` Domain that relates to the report. - `mitigation_summary: ReportMitigationSummary` A summary of the mitigations related to this report. - `accepted_url_count: int` How many of the reported URLs were confirmed as abusive. - `active_count: int` How many mitigations are active. - `external_host_notified: bool` Whether the report has been forwarded to an external hosting provider. - `in_review_count: int` How many mitigations are under review. - `pending_count: int` How many mitigations are pending their effective date. - `status: Literal["accepted", "in_review"]` An enum value that represents the status of an abuse record - `"accepted"` - `"in_review"` - `type: Literal["PHISH", "GEN", "THREAT", 6 more]` The abuse report type - `"PHISH"` - `"GEN"` - `"THREAT"` - `"DMCA"` - `"EMER"` - `"TM"` - `"REG_WHO"` - `"NCSEI"` - `"NETWORK"` - `justification: Optional[str]` Justification for the report. - `original_work: Optional[str]` Original work / Targeted brand in the alleged abuse. - `submitter: Optional[ReportSubmitter]` Information about the submitter of the report. - `company: Optional[str]` - `email: Optional[str]` - `name: Optional[str]` - `telephone: Optional[str]` - `urls: Optional[List[str]]` # Mitigations ## List abuse report mitigations `abuse_reports.mitigations.list(strreport_id, MitigationListParams**kwargs) -> SyncV4PagePagination[Optional[MitigationListResponse]]` **get** `/accounts/{account_id}/abuse-reports/{report_id}/mitigations` List mitigations done to remediate the abuse report. ### Parameters - `account_id: str` - `report_id: str` - `effective_after: Optional[str]` Returns mitigation that were dispatched after the given date - `effective_before: Optional[str]` Returns mitigations that were dispatched before the given date - `entity_type: Optional[Literal["url_pattern", "account", "zone"]]` Filter by the type of entity the mitigation impacts. - `"url_pattern"` - `"account"` - `"zone"` - `page: Optional[int]` Where in pagination to start listing abuse reports - `per_page: Optional[int]` How many abuse reports per page to list - `sort: Optional[Literal["type,asc", "type,desc", "effective_date,asc", 5 more]]` A property to sort by, followed by the order - `"type,asc"` - `"type,desc"` - `"effective_date,asc"` - `"effective_date,desc"` - `"status,asc"` - `"status,desc"` - `"entity_type,asc"` - `"entity_type,desc"` - `status: Optional[Literal["pending", "active", "in_review", 2 more]]` Filter by the status of the mitigation. - `"pending"` - `"active"` - `"in_review"` - `"cancelled"` - `"removed"` - `type: Optional[Literal["legal_block", "misleading_interstitial", "phishing_interstitial", 4 more]]` Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set, e.g. ?type=rate_limit_cache&type=legal_block. - `"legal_block"` - `"misleading_interstitial"` - `"phishing_interstitial"` - `"network_block"` - `"rate_limit_cache"` - `"account_suspend"` - `"redirect_video_stream"` ### Returns - `class MitigationListResponse: …` - `mitigations: List[Mitigation]` - `id: str` ID of remediation. - `effective_date: str` Date when the mitigation will become active. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `entity_id: str` - `entity_type: Literal["url_pattern", "account", "zone"]` - `"url_pattern"` - `"account"` - `"zone"` - `status: Literal["pending", "active", "in_review", 2 more]` The status of a mitigation - `"pending"` - `"active"` - `"in_review"` - `"cancelled"` - `"removed"` - `type: Literal["legal_block", "misleading_interstitial", "phishing_interstitial", 4 more]` The type of mitigation - `"legal_block"` - `"misleading_interstitial"` - `"phishing_interstitial"` - `"network_block"` - `"rate_limit_cache"` - `"account_suspend"` - `"redirect_video_stream"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.abuse_reports.mitigations.list( report_id="report_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result.items[0] print(page.mitigations) ``` #### Response ```json { "success": true, "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": { "mitigations": [ { "id": "id", "effective_date": "2009-11-10T23:00:00Z", "entity_id": "entity_id", "entity_type": "url_pattern", "status": "pending", "type": "legal_block" } ] }, "result_info": { "count": 0, "page": 0, "per_page": 0, "total_count": 0, "total_pages": 0 } } ``` ## Request review on mitigations `abuse_reports.mitigations.review(strreport_id, MitigationReviewParams**kwargs) -> SyncSinglePage[MitigationReviewResponse]` **post** `/accounts/{account_id}/abuse-reports/{report_id}/mitigations/appeal` Request a review for mitigations on an account. ### Parameters - `account_id: str` - `report_id: str` - `appeals: Iterable[Appeal]` List of mitigations to appeal. - `id: str` ID of the mitigation to appeal. - `reason: Literal["removed", "misclassified"]` Reason why the customer is appealing. - `"removed"` - `"misclassified"` ### Returns - `class MitigationReviewResponse: …` - `id: str` ID of remediation. - `effective_date: str` Date when the mitigation will become active. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `entity_id: str` - `entity_type: Literal["url_pattern", "account", "zone"]` - `"url_pattern"` - `"account"` - `"zone"` - `status: Literal["pending", "active", "in_review", 2 more]` The status of a mitigation - `"pending"` - `"active"` - `"in_review"` - `"cancelled"` - `"removed"` - `type: Literal["legal_block", "misleading_interstitial", "phishing_interstitial", 4 more]` The type of mitigation - `"legal_block"` - `"misleading_interstitial"` - `"phishing_interstitial"` - `"network_block"` - `"rate_limit_cache"` - `"account_suspend"` - `"redirect_video_stream"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.abuse_reports.mitigations.review( report_id="report_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", appeals=[{ "id": "id", "reason": "misclassified", }], ) page = page.result[0] print(page.id) ``` #### Response ```json { "result_info": { "count": 0, "page": 0, "per_page": 0, "total_count": 0, "total_pages": 0 }, "success": true, "errors": [ { "message": "message" } ], "messages": [ { "message": "message" } ], "result": [ { "id": "id", "effective_date": "2009-11-10T23:00:00Z", "entity_id": "entity_id", "entity_type": "url_pattern", "status": "pending", "type": "legal_block" } ] } ``` ## Domain Types ### Mitigation List Response - `class MitigationListResponse: …` - `mitigations: List[Mitigation]` - `id: str` ID of remediation. - `effective_date: str` Date when the mitigation will become active. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `entity_id: str` - `entity_type: Literal["url_pattern", "account", "zone"]` - `"url_pattern"` - `"account"` - `"zone"` - `status: Literal["pending", "active", "in_review", 2 more]` The status of a mitigation - `"pending"` - `"active"` - `"in_review"` - `"cancelled"` - `"removed"` - `type: Literal["legal_block", "misleading_interstitial", "phishing_interstitial", 4 more]` The type of mitigation - `"legal_block"` - `"misleading_interstitial"` - `"phishing_interstitial"` - `"network_block"` - `"rate_limit_cache"` - `"account_suspend"` - `"redirect_video_stream"` ### Mitigation Review Response - `class MitigationReviewResponse: …` - `id: str` ID of remediation. - `effective_date: str` Date when the mitigation will become active. Time in RFC 3339 format (https://www.rfc-editor.org/rfc/rfc3339.html) - `entity_id: str` - `entity_type: Literal["url_pattern", "account", "zone"]` - `"url_pattern"` - `"account"` - `"zone"` - `status: Literal["pending", "active", "in_review", 2 more]` The status of a mitigation - `"pending"` - `"active"` - `"in_review"` - `"cancelled"` - `"removed"` - `type: Literal["legal_block", "misleading_interstitial", "phishing_interstitial", 4 more]` The type of mitigation - `"legal_block"` - `"misleading_interstitial"` - `"phishing_interstitial"` - `"network_block"` - `"rate_limit_cache"` - `"account_suspend"` - `"redirect_video_stream"`