- summary - Get the analytics summary
- policies - Get the most flagged policies
- authors - Get the most flagged authors
- channels - Get analytics per channel
- volumes - Get volumes over time
- automation - Get the automation breakdown
Get the totals of the project for a time window: requests, flags, flag rate, allowed, rejected and sent to review, with the window before for the trend. Also the review queue backlog and a flag-rate spike, if there is one.
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->analytics->summary(
range: Operations\GetAnalyticsSummaryQueryParamRange::Thirtyd
);
if ($response->object !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
range |
?Operations\GetAnalyticsSummaryQueryParamRange | ➖ | 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. |
channel |
?string | ➖ | N/A |
projectId |
?string | ➖ | 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. |
?Operations\GetAnalyticsSummaryResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestError | 400 | application/json |
| Errors\AuthenticationError | 401 | application/json |
| Errors\PermissionDeniedError | 403 | application/json |
| Errors\NotFoundError | 404 | application/json |
| Errors\RateLimitError | 429 | application/json |
| Errors\InternalServerError | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before.
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->analytics->policies(
range: Operations\GetAnalyticsPoliciesQueryParamRange::Thirtyd,
limit: 8
);
if ($response->object !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
range |
?Operations\GetAnalyticsPoliciesQueryParamRange | ➖ | 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. |
channel |
?string | ➖ | N/A |
limit |
?int | ➖ | N/A |
projectId |
?string | ➖ | 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. |
?Operations\GetAnalyticsPoliciesResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestError | 400 | application/json |
| Errors\AuthenticationError | 401 | application/json |
| Errors\PermissionDeniedError | 403 | application/json |
| Errors\NotFoundError | 404 | application/json |
| Errors\RateLimitError | 429 | application/json |
| Errors\InternalServerError | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Get the authors with the most flagged content in a time window, largest first.
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->analytics->authors(
range: Operations\GetAnalyticsAuthorsQueryParamRange::Thirtyd,
limit: 6
);
if ($response->object !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
range |
?Operations\GetAnalyticsAuthorsQueryParamRange | ➖ | 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. |
channel |
?string | ➖ | N/A |
limit |
?int | ➖ | N/A |
projectId |
?string | ➖ | 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. |
?Operations\GetAnalyticsAuthorsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestError | 400 | application/json |
| Errors\AuthenticationError | 401 | application/json |
| Errors\PermissionDeniedError | 403 | application/json |
| Errors\NotFoundError | 404 | application/json |
| Errors\RateLimitError | 429 | application/json |
| Errors\InternalServerError | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Get requests, flags and flag rate for each channel of the project in a time window.
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->analytics->channels(
range: Operations\GetAnalyticsChannelsQueryParamRange::Thirtyd
);
if ($response->object !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
range |
?Operations\GetAnalyticsChannelsQueryParamRange | ➖ | 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. |
projectId |
?string | ➖ | 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. |
?Operations\GetAnalyticsChannelsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestError | 400 | application/json |
| Errors\AuthenticationError | 401 | application/json |
| Errors\PermissionDeniedError | 403 | application/json |
| Errors\NotFoundError | 404 | application/json |
| Errors\RateLimitError | 429 | application/json |
| Errors\InternalServerError | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Get requests, flags, rejections and reviews per hour (24h) or per day (7d, 30d, 90d), oldest first.
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->analytics->volumes(
range: Operations\GetAnalyticsVolumesQueryParamRange::Thirtyd
);
if ($response->object !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
range |
?Operations\GetAnalyticsVolumesQueryParamRange | ➖ | 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. |
channel |
?string | ➖ | N/A |
projectId |
?string | ➖ | 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. |
?Operations\GetAnalyticsVolumesResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestError | 400 | application/json |
| Errors\AuthenticationError | 401 | application/json |
| Errors\PermissionDeniedError | 403 | application/json |
| Errors\NotFoundError | 404 | application/json |
| Errors\RateLimitError | 429 | application/json |
| Errors\InternalServerError | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
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.
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->analytics->automation(
range: Operations\GetAnalyticsAutomationQueryParamRange::Thirtyd
);
if ($response->object !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
range |
?Operations\GetAnalyticsAutomationQueryParamRange | ➖ | 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. |
channel |
?string | ➖ | N/A |
projectId |
?string | ➖ | 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. |
?Operations\GetAnalyticsAutomationResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestError | 400 | application/json |
| Errors\AuthenticationError | 401 | application/json |
| Errors\PermissionDeniedError | 403 | application/json |
| Errors\NotFoundError | 404 | application/json |
| Errors\RateLimitError | 429 | application/json |
| Errors\InternalServerError | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |