/api/v1/moderation/{id}/actionsRecords the action and sends it to your system as a moderation.action webhook. Detectivision does not carry it out. At most 60 a minute per account. Free.
Path parameters#
| Parameter | Type | Description |
|---|---|---|
id required |
integer |
The request's id. |
Request body#
Content type: application/json.
-
actionstring requiredThe key of one of your actions.
-
notestringSent with the action. At most 500 characters.
Responses#
201#
The action, recorded and on its way.
-
idinteger required -
keystring required -
labelstring required -
byobject (Actor) requiredWho took an action.
-
notestring or null required -
atinteger requiredWhen, in Unix seconds.
by (Actor)
-
typestring requiredOne of:
user,api.user: someone in the dashboard;api: a call with an API key. -
namestring requiredThe person's name, or the API key's label.
400#
Not one of your actions (the message lists them), or a malformed body.
{
"error": "invalid_request",
"message": "Unknown action nope. Actions: ban, keep."
}401#
Missing, unknown, revoked or expired API key, or the account is not active.
{
"error": "unauthorized",
"message": "The API key is not valid."
}403#
The key may not do this: a read key on a write endpoint, or a restricted key.
{
"error": "forbidden",
"message": "This API key does not have write permission"
}404#
No such request for this account.
{
"error": "not_found",
"message": "No such request."
}429#
More than 60 actions in a minute through the API. Nothing was taken.
Header Retry-After: Seconds to wait before trying again.
{
"error": "too_many_requests",
"message": "At most 60 actions a minute through the API"
}Request
curl -X POST https://api.detectivision.ai/api/v1/moderation/{id}/actions \
-H "Api-Key: $DETECTIVISION_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "ban",
"note": "spam account"
}'import os, requests
r = requests.post(
"https://api.detectivision.ai/api/v1/moderation/{id}/actions",
headers={"Api-Key": os.environ["DETECTIVISION_API_KEY"]},
json={
"action": "ban",
"note": "spam account"
},
)
print(r.status_code, r.json())const res = await fetch("https://api.detectivision.ai/api/v1/moderation/{id}/actions", {
method: "POST",
headers: {
"Api-Key": process.env.DETECTIVISION_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"action": "ban",
"note": "spam account"
}),
});
console.log(res.status, await res.json());