curl --request POST \
--url https://api.member.dev/api/v1/hubs/{hub_id}/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"reportable_id": "<string>",
"reportable_type": "<string>",
"notes": "<string>",
"reason_id": "<string>",
"reason_ids": [
"<string>"
]
},
"type": "moderation_reports"
}
}
'import requests
url = "https://api.member.dev/api/v1/hubs/{hub_id}/reports"
payload = { "data": {
"attributes": {
"reportable_id": "<string>",
"reportable_type": "<string>",
"notes": "<string>",
"reason_id": "<string>",
"reason_ids": ["<string>"]
},
"type": "moderation_reports"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
attributes: {
reportable_id: '<string>',
reportable_type: '<string>',
notes: '<string>',
reason_id: '<string>',
reason_ids: ['<string>']
},
type: 'moderation_reports'
}
})
};
fetch('https://api.member.dev/api/v1/hubs/{hub_id}/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.member.dev/api/v1/hubs/{hub_id}/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([
'data' => [
'attributes' => [
'reportable_id' => '<string>',
'reportable_type' => '<string>',
'notes' => '<string>',
'reason_id' => '<string>',
'reason_ids' => [
'<string>'
]
],
'type' => 'moderation_reports'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$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.member.dev/api/v1/hubs/{hub_id}/reports"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"reportable_id\": \"<string>\",\n \"reportable_type\": \"<string>\",\n \"notes\": \"<string>\",\n \"reason_id\": \"<string>\",\n \"reason_ids\": [\n \"<string>\"\n ]\n },\n \"type\": \"moderation_reports\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.member.dev/api/v1/hubs/{hub_id}/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"reportable_id\": \"<string>\",\n \"reportable_type\": \"<string>\",\n \"notes\": \"<string>\",\n \"reason_id\": \"<string>\",\n \"reason_ids\": [\n \"<string>\"\n ]\n },\n \"type\": \"moderation_reports\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/hubs/{hub_id}/reports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"reportable_id\": \"<string>\",\n \"reportable_type\": \"<string>\",\n \"notes\": \"<string>\",\n \"reason_id\": \"<string>\",\n \"reason_ids\": [\n \"<string>\"\n ]\n },\n \"type\": \"moderation_reports\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"created_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"reason_id": "<string>",
"reason_ids": [
"<string>"
],
"reportable_id": "<string>",
"reportable_type": "<string>",
"resolution": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"status": "<string>"
},
"id": "<string>",
"type": "moderation_reports"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}File Report
File a moderation report against a community entity.
Validates membership, prevents self-reports, and enforces a 24-hour duplicate guard.
Returns 201 Created with the new report on success. Returns 403 when the hub does not exist, the reporter is not a hub member, or the reporter is banned/soft-banned. All three cases return an identical response body so that hub IDs cannot be enumerated. Returns 422 when the report fails validation (self-report, duplicate, etc.), or when reportable_type is unsupported (e.g. ‘message’ — see FILEABLE_REPORTABLE_TYPES in schemas.py).
Security (R2.I1): hub-existence resolution happens INSIDE the route body using _err(), not via a Depends() that raises HTTPException. This ensures the “hub missing” 403 and the “not a member” 403 go through the same code path and produce byte-identical response bodies, preventing hub enumeration.
curl --request POST \
--url https://api.member.dev/api/v1/hubs/{hub_id}/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"attributes": {
"reportable_id": "<string>",
"reportable_type": "<string>",
"notes": "<string>",
"reason_id": "<string>",
"reason_ids": [
"<string>"
]
},
"type": "moderation_reports"
}
}
'import requests
url = "https://api.member.dev/api/v1/hubs/{hub_id}/reports"
payload = { "data": {
"attributes": {
"reportable_id": "<string>",
"reportable_type": "<string>",
"notes": "<string>",
"reason_id": "<string>",
"reason_ids": ["<string>"]
},
"type": "moderation_reports"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
attributes: {
reportable_id: '<string>',
reportable_type: '<string>',
notes: '<string>',
reason_id: '<string>',
reason_ids: ['<string>']
},
type: 'moderation_reports'
}
})
};
fetch('https://api.member.dev/api/v1/hubs/{hub_id}/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.member.dev/api/v1/hubs/{hub_id}/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([
'data' => [
'attributes' => [
'reportable_id' => '<string>',
'reportable_type' => '<string>',
'notes' => '<string>',
'reason_id' => '<string>',
'reason_ids' => [
'<string>'
]
],
'type' => 'moderation_reports'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$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.member.dev/api/v1/hubs/{hub_id}/reports"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"reportable_id\": \"<string>\",\n \"reportable_type\": \"<string>\",\n \"notes\": \"<string>\",\n \"reason_id\": \"<string>\",\n \"reason_ids\": [\n \"<string>\"\n ]\n },\n \"type\": \"moderation_reports\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.member.dev/api/v1/hubs/{hub_id}/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"attributes\": {\n \"reportable_id\": \"<string>\",\n \"reportable_type\": \"<string>\",\n \"notes\": \"<string>\",\n \"reason_id\": \"<string>\",\n \"reason_ids\": [\n \"<string>\"\n ]\n },\n \"type\": \"moderation_reports\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/hubs/{hub_id}/reports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"reportable_id\": \"<string>\",\n \"reportable_type\": \"<string>\",\n \"notes\": \"<string>\",\n \"reason_id\": \"<string>\",\n \"reason_ids\": [\n \"<string>\"\n ]\n },\n \"type\": \"moderation_reports\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"created_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"reason_id": "<string>",
"reason_ids": [
"<string>"
],
"reportable_id": "<string>",
"reportable_type": "<string>",
"resolution": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"status": "<string>"
},
"id": "<string>",
"type": "moderation_reports"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes