Skip to main content
POST
/
abuse_reports
Create
curl --request POST \
  --url https://api.ngrok.com/abuse_reports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'ngrok-version: <ngrok-version>' \
  --data '
{
  "urls": [
    "<string>"
  ],
  "metadata": "<string>"
}
'
import requests

url = "https://api.ngrok.com/abuse_reports"

payload = {
    "urls": ["<string>"],
    "metadata": "<string>"
}
headers = {
    "ngrok-version": "<ngrok-version>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'ngrok-version': '<ngrok-version>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({urls: ['<string>'], metadata: '<string>'})
};

fetch('https://api.ngrok.com/abuse_reports', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.ngrok.com/abuse_reports",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'urls' => [
        '<string>'
    ],
    'metadata' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "ngrok-version: <ngrok-version>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ngrok.com/abuse_reports"

	payload := strings.NewReader("{\n  \"urls\": [\n    \"<string>\"\n  ],\n  \"metadata\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("ngrok-version", "<ngrok-version>")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.ngrok.com/abuse_reports")
  .header("ngrok-version", "<ngrok-version>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"urls\": [\n    \"<string>\"\n  ],\n  \"metadata\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.ngrok.com/abuse_reports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"urls\": [\n    \"<string>\"\n  ],\n  \"metadata\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "uri": "<string>",
  "created_at": "<string>",
  "urls": [
    "<string>"
  ],
  "metadata": "<string>",
  "status": "<string>",
  "hostnames": [
    {
      "hostname": "<string>",
      "status": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

ngrok-version
integer
default:2
required

Body

application/json
urls
string[]
required

a list of URLs containing suspected abusive content

metadata
string

arbitrary user-defined data about this abuse report. Optional, max 4096 bytes.

Response

201 - application/json

Creates a new abuse report which will be reviewed by our system and abuse response team. This API is only available to authorized accounts. Contact abuse@ngrok.com to request access

id
string

ID of the abuse report

uri
string

URI of the abuse report API resource

created_at
string

timestamp that the abuse report record was created in RFC 3339 format

urls
string[]

a list of URLs containing suspected abusive content

metadata
string

arbitrary user-defined data about this abuse report. Optional, max 4096 bytes.

status
string

Indicates whether ngrok has processed the abuse report. one of PENDING, PROCESSED, or PARTIALLY_PROCESSED

hostnames
object[]

an array of hostname statuses related to the report