import ModerationAPI from '@moderation-api/sdk';
const client = new ModerationAPI({
secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
});
const actions = await client.actions.list();
console.log(actions);import os
from moderation_api import ModerationAPI
client = ModerationAPI(
secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted
)
actions = client.actions.list()
print(actions)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
actions = moderation_api.actions.list
puts(actions)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ModerationAPI\Client;
use ModerationAPI\Core\Exceptions\APIException;
$client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My Secret Key');
try {
$actions = $client->actions->list(queueID: 'queueId');
var_dump($actions);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions;
ModerationApiClient client = new();
ActionListParams parameters = new();
var actions = await client.Actions.List(parameters);
Console.WriteLine(actions);[
{
"id": "<string>",
"createdAt": "<string>",
"name": "<string>",
"builtIn": false,
"queueBehaviour": "NO_CHANGE",
"filterInQueueIds": [],
"position": "ALL_QUEUES",
"possibleValues": [],
"valueRequired": false,
"freeText": false,
"key": "<string>",
"description": "<string>",
"type": "AUTHOR_BLOCK"
}
]{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}List moderation actions
List all available moderation actions for the authenticated organization.
import ModerationAPI from '@moderation-api/sdk';
const client = new ModerationAPI({
secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
});
const actions = await client.actions.list();
console.log(actions);import os
from moderation_api import ModerationAPI
client = ModerationAPI(
secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted
)
actions = client.actions.list()
print(actions)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
actions = moderation_api.actions.list
puts(actions)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ModerationAPI\Client;
use ModerationAPI\Core\Exceptions\APIException;
$client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My Secret Key');
try {
$actions = $client->actions->list(queueID: 'queueId');
var_dump($actions);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions;
ModerationApiClient client = new();
ActionListParams parameters = new();
var actions = await client.Actions.List(parameters);
Console.WriteLine(actions);[
{
"id": "<string>",
"createdAt": "<string>",
"name": "<string>",
"builtIn": false,
"queueBehaviour": "NO_CHANGE",
"filterInQueueIds": [],
"position": "ALL_QUEUES",
"possibleValues": [],
"valueRequired": false,
"freeText": false,
"key": "<string>",
"description": "<string>",
"type": "AUTHOR_BLOCK"
}
]{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response
Successful response
The ID of the action.
The date the action was created.
The name of the action.
Whether the action is a built-in action or a custom one.
Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.
REMOVE, ADD, NO_CHANGE The IDs of the queues the action is available in.
Show the action in all queues, selected queues or no queues (to use via API only).
ALL_QUEUES, SOME_QUEUES, HIDDEN The possible values of the action. The user will be prompted to select one of these values when executing the action.
Show child attributes
Show child attributes
Whether the action requires a value to be executed.
Whether the action allows any text to be entered as a value or if it must be one of the possible values.
User defined key of the action.
The description of the action.
The type of the action.
AUTHOR_BLOCK, AUTHOR_BLOCK_TEMP, AUTHOR_UNBLOCK, AUTHOR_DELETE, AUTHOR_REPORT, AUTHOR_WARN, AUTHOR_CUSTOM, ITEM_REJECT, ITEM_ALLOW, ITEM_CUSTOM Was this page helpful?