TypeScript
import { ModerationApi } from "@moderation-api/sdk";
const moderationApi = new ModerationApi({
secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
});
async function run() {
const result = await moderationApi.authors.list({});
for await (const page of result) {
console.log(page);
}
}
run();
import os
from moderation_api import ModerationAPI
with ModerationAPI(
secret_key=os.environ["MODAPI_SECRET_KEY"],
) as moderation_api:
res = moderation_api.authors.list(page=1, page_size=20, sort_direction="desc")
while res is not None:
# Handle items
res = res.next()
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
getenv('MODAPI_SECRET_KEY')
)
->build();
$request = new Operations\ListAuthorsRequest();
$responses = $sdk->authors->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
require 'moderation_api'
Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
secret_key: ENV.fetch('MODAPI_SECRET_KEY')
)
req = Models::Operations::ListAuthorsRequest.new
res = s.authors.list(request: req)
unless res.object.nil?
# handle response
end
modapi authors list --secret-key "$MODAPI_SECRET_KEY" --page 1 --page-size 20 --sort-direction desc
{
"data": [
{
"id": "<string>",
"first_seen": 123,
"last_seen": 123,
"status": "enabled",
"trust_level": {
"level": 123,
"manual": true
},
"block": {
"until": 123,
"reason": "<string>"
},
"risk_evaluation": {
"risk_level": 50
},
"metrics": {
"total_content": 123,
"flagged_content": 123,
"average_sentiment": 123
},
"metadata": {
"email_verified": true,
"phone_verified": true,
"identity_verified": true,
"is_paying_customer": true
},
"external_id": "<string>",
"profile_picture": "<string>",
"external_link": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"company": "<string>",
"last_incident": 123
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true
}
}{
"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>"
}
]
}List authors (Enterprise)
List authors with their activity metrics and reputation. The list is paginated.
TypeScript
import { ModerationApi } from "@moderation-api/sdk";
const moderationApi = new ModerationApi({
secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
});
async function run() {
const result = await moderationApi.authors.list({});
for await (const page of result) {
console.log(page);
}
}
run();
import os
from moderation_api import ModerationAPI
with ModerationAPI(
secret_key=os.environ["MODAPI_SECRET_KEY"],
) as moderation_api:
res = moderation_api.authors.list(page=1, page_size=20, sort_direction="desc")
while res is not None:
# Handle items
res = res.next()
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
getenv('MODAPI_SECRET_KEY')
)
->build();
$request = new Operations\ListAuthorsRequest();
$responses = $sdk->authors->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
require 'moderation_api'
Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
secret_key: ENV.fetch('MODAPI_SECRET_KEY')
)
req = Models::Operations::ListAuthorsRequest.new
res = s.authors.list(request: req)
unless res.object.nil?
# handle response
end
modapi authors list --secret-key "$MODAPI_SECRET_KEY" --page 1 --page-size 20 --sort-direction desc
{
"data": [
{
"id": "<string>",
"first_seen": 123,
"last_seen": 123,
"status": "enabled",
"trust_level": {
"level": 123,
"manual": true
},
"block": {
"until": 123,
"reason": "<string>"
},
"risk_evaluation": {
"risk_level": 50
},
"metrics": {
"total_content": 123,
"flagged_content": 123,
"average_sentiment": 123
},
"metadata": {
"email_verified": true,
"phone_verified": true,
"identity_verified": true,
"is_paying_customer": true
},
"external_id": "<string>",
"profile_picture": "<string>",
"external_link": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"company": "<string>",
"last_incident": 123
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true
}
}{
"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
Page number, starting at 1.
Required range:
1 <= x <= 100000Number of items per page. Maximum 100.
Required range:
1 <= x <= 100Available options:
trustLevel, violationCount, reportCount, memberSince, lastActive, contentCount, flaggedContentRatio, averageSentiment Sort direction
Available options:
asc, desc Was this page helpful?