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
List the authors of the project, with their status, trust level and content metrics. The list is paginated. By default, the authors that were active most recently come first.
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
Headers
Query Parameters
Was this page helpful?