Skip to main content
JavaScript
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 response = await client.actions.execute.executeByID('actionId');

console.log(response.ids);
{
  "success": true,
  "actionId": "<string>",
  "ids": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

actionId
string
required

The ID or key of the action to execute.

Body

application/json
contentIds
string[]

The IDs of the content items to perform the action on.

authorIds
string[]

IDs of the authors to apply the action to

queueId
string

The ID of the queue the action was performed from if any.

value
string

The value of the action. Useful to set a reason for the action etc.

Response

Action executed successfully

success
boolean
required

Action executed successfully.

actionId
string
required

The ID of the action.

ids
string[]
required

The IDs of the content items.