Execute an action
curl --request POST \
--url https://api.moderationapi.com/v1/actions/{actionId}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentIds": [
"<string>"
],
"authorIds": [
"<string>"
],
"queueId": "<string>",
"value": "<string>"
}
'import requests
url = "https://api.moderationapi.com/v1/actions/{actionId}/execute"
payload = {
"contentIds": ["<string>"],
"authorIds": ["<string>"],
"queueId": "<string>",
"value": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentIds: ['<string>'],
authorIds: ['<string>'],
queueId: '<string>',
value: '<string>'
})
};
fetch('https://api.moderationapi.com/v1/actions/{actionId}/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moderationapi.com/v1/actions/{actionId}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contentIds' => [
'<string>'
],
'authorIds' => [
'<string>'
],
'queueId' => '<string>',
'value' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.moderationapi.com/v1/actions/{actionId}/execute"
payload := strings.NewReader("{\n \"contentIds\": [\n \"<string>\"\n ],\n \"authorIds\": [\n \"<string>\"\n ],\n \"queueId\": \"<string>\",\n \"value\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.moderationapi.com/v1/actions/{actionId}/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentIds\": [\n \"<string>\"\n ],\n \"authorIds\": [\n \"<string>\"\n ],\n \"queueId\": \"<string>\",\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moderationapi.com/v1/actions/{actionId}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentIds\": [\n \"<string>\"\n ],\n \"authorIds\": [\n \"<string>\"\n ],\n \"queueId\": \"<string>\",\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"actionId": "<string>",
"ids": [
"<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": "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>"
}
]
}Execute an action
deprecated
Execute an action on a set of content items in a queue.
Execute an action
curl --request POST \
--url https://api.moderationapi.com/v1/actions/{actionId}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentIds": [
"<string>"
],
"authorIds": [
"<string>"
],
"queueId": "<string>",
"value": "<string>"
}
'import requests
url = "https://api.moderationapi.com/v1/actions/{actionId}/execute"
payload = {
"contentIds": ["<string>"],
"authorIds": ["<string>"],
"queueId": "<string>",
"value": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentIds: ['<string>'],
authorIds: ['<string>'],
queueId: '<string>',
value: '<string>'
})
};
fetch('https://api.moderationapi.com/v1/actions/{actionId}/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moderationapi.com/v1/actions/{actionId}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contentIds' => [
'<string>'
],
'authorIds' => [
'<string>'
],
'queueId' => '<string>',
'value' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.moderationapi.com/v1/actions/{actionId}/execute"
payload := strings.NewReader("{\n \"contentIds\": [\n \"<string>\"\n ],\n \"authorIds\": [\n \"<string>\"\n ],\n \"queueId\": \"<string>\",\n \"value\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.moderationapi.com/v1/actions/{actionId}/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentIds\": [\n \"<string>\"\n ],\n \"authorIds\": [\n \"<string>\"\n ],\n \"queueId\": \"<string>\",\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moderationapi.com/v1/actions/{actionId}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentIds\": [\n \"<string>\"\n ],\n \"authorIds\": [\n \"<string>\"\n ],\n \"queueId\": \"<string>\",\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"actionId": "<string>",
"ids": [
"<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": "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>"
}
]
}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.
Path Parameters
The ID or key of the action to execute.
Body
application/json
Was this page helpful?