TypeScript
import { ModerationApi } from "@moderation-api/sdk";
const moderationApi = new ModerationApi({
secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
});
async function run() {
const result = await moderationApi.queue.items.resolve({
id: "<id>",
itemId: "<id>",
body: {
comment: "Reviewed: no violation.",
},
});
console.log(result);
}
run();
import os
from moderation_api import ModerationAPI
with ModerationAPI(
secret_key=os.environ["MODAPI_SECRET_KEY"],
) as moderation_api:
res = moderation_api.queue.items.resolve(id="<id>", item_id="<id>", comment="Reviewed: no violation.")
# Handle response
print(res)
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
getenv('MODAPI_SECRET_KEY')
)
->build();
$body = new Operations\ResolveQueueItemRequestBody(
comment: 'Reviewed: no violation.',
);
$response = $sdk->queue->items->resolve(
id: '<id>',
itemId: '<id>',
body: $body
);
if ($response->object !== null) {
// handle response
}
require 'moderation_api'
Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
secret_key: ENV.fetch('MODAPI_SECRET_KEY')
)
res = s.queue.items.resolve(id: '<id>', item_id: '<id>', body: Models::Operations::ResolveQueueItemRequestBody.new(
comment: 'Reviewed: no violation.'
))
unless res.object.nil?
# handle response
end
modapi queue items resolve --secret-key "$MODAPI_SECRET_KEY" --id '<id>' --item-id '<id>' --comment 'Reviewed: no violation.'
{
"success": true,
"resolvedAt": "<string>"
}{
"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": "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>"
}
]
}Resolve a queue item
Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use POST /actions/execute.
TypeScript
import { ModerationApi } from "@moderation-api/sdk";
const moderationApi = new ModerationApi({
secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
});
async function run() {
const result = await moderationApi.queue.items.resolve({
id: "<id>",
itemId: "<id>",
body: {
comment: "Reviewed: no violation.",
},
});
console.log(result);
}
run();
import os
from moderation_api import ModerationAPI
with ModerationAPI(
secret_key=os.environ["MODAPI_SECRET_KEY"],
) as moderation_api:
res = moderation_api.queue.items.resolve(id="<id>", item_id="<id>", comment="Reviewed: no violation.")
# Handle response
print(res)
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
getenv('MODAPI_SECRET_KEY')
)
->build();
$body = new Operations\ResolveQueueItemRequestBody(
comment: 'Reviewed: no violation.',
);
$response = $sdk->queue->items->resolve(
id: '<id>',
itemId: '<id>',
body: $body
);
if ($response->object !== null) {
// handle response
}
require 'moderation_api'
Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
secret_key: ENV.fetch('MODAPI_SECRET_KEY')
)
res = s.queue.items.resolve(id: '<id>', item_id: '<id>', body: Models::Operations::ResolveQueueItemRequestBody.new(
comment: 'Reviewed: no violation.'
))
unless res.object.nil?
# handle response
end
modapi queue items resolve --secret-key "$MODAPI_SECRET_KEY" --id '<id>' --item-id '<id>' --comment 'Reviewed: no violation.'
{
"success": true,
"resolvedAt": "<string>"
}{
"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": "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.
Was this page helpful?