curl --request GET \
--url https://api.moderationapi.com/v1/analytics/automation \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moderationapi.com/v1/analytics/automation"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moderationapi.com/v1/analytics/automation', 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.moderationapi.com/v1/analytics/automation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moderationapi.com/v1/analytics/automation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moderationapi.com/v1/analytics/automation")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moderationapi.com/v1/analytics/automation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"range": "24h",
"channelId": "<string>",
"flagged": 1,
"handledByRules": 1,
"handledByCasebook": 1,
"sentToReview": 1,
"mergedDuplicates": 1,
"automationRate": 0.5,
"reviewsAllowed": 1,
"reviewsRejected": 1,
"reviewsResolvedWithoutDecision": 1,
"reviewsUnresolved": 1,
"casebookOverrulings": 1,
"rules": [
{
"name": "<string>",
"count": 1
}
]
}{
"type": "invalid_request_error",
"code": "invalid_request",
"message": "Invalid input data",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "authentication_error",
"code": "unauthorized",
"message": "Authorization not provided",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "permission_error",
"code": "permission_denied",
"message": "Insufficient access",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "not_found_error",
"code": "resource_not_found",
"message": "Not found",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "api_error",
"code": "internal_error",
"message": "Internal server error",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}Get the automation breakdown
Get how flagged content was handled in a time window: settled by rules or the casebook, or sent to human review, and what the reviewers decided.
curl --request GET \
--url https://api.moderationapi.com/v1/analytics/automation \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moderationapi.com/v1/analytics/automation"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moderationapi.com/v1/analytics/automation', 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.moderationapi.com/v1/analytics/automation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moderationapi.com/v1/analytics/automation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moderationapi.com/v1/analytics/automation")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moderationapi.com/v1/analytics/automation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"range": "24h",
"channelId": "<string>",
"flagged": 1,
"handledByRules": 1,
"handledByCasebook": 1,
"sentToReview": 1,
"mergedDuplicates": 1,
"automationRate": 0.5,
"reviewsAllowed": 1,
"reviewsRejected": 1,
"reviewsResolvedWithoutDecision": 1,
"reviewsUnresolved": 1,
"casebookOverrulings": 1,
"rules": [
{
"name": "<string>",
"count": 1
}
]
}{
"type": "invalid_request_error",
"code": "invalid_request",
"message": "Invalid input data",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "authentication_error",
"code": "unauthorized",
"message": "Authorization not provided",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "permission_error",
"code": "permission_denied",
"message": "Insufficient access",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "not_found_error",
"code": "resource_not_found",
"message": "Not found",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "api_error",
"code": "internal_error",
"message": "Internal server error",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.
Query Parameters
The time window. 24h is the last 24 hours, in hourly buckets. 7d, 30d and 90d are whole UTC days that end with today, in daily buckets.
24h, 7d, 30d, 90d A channel ID or key. Only count content from this channel. Leave out to count all channels.
Response
Successful response
The time window of the numbers.
24h, 7d, 30d, 90d The channel the numbers are for. Null when they are for all channels.
Flagged requests in the window. Counted on a rolling window from the raw requests, so it can be a little different from the summary.
x >= 0Flagged requests that a rule allowed or rejected without human review.
x >= 0Flagged requests that the casebook settled without human review.
x >= 0Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue.
x >= 0Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later.
x >= 0The share of flagged requests that did not need their own human review: (flagged - sentToReview) / flagged.
0 <= x <= 1Review queue items from this window that a moderator allowed.
x >= 0Review queue items from this window that a moderator rejected.
x >= 0Review queue items from this window that a moderator marked as done without allow or reject.
x >= 0Review queue items from this window that are still open.
x >= 0Requests where the casebook decision was different from the decision based on severity.
x >= 0The rules that settled flagged requests without review, largest first. The 5 largest have their own entry. The casebook is one of the rules.
Show child attributes
Show child attributes
Was this page helpful?