POST
/
actions
curl --request POST \
  --url https://moderationapi.com/api/v1/actions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Suspend author",
  "description": "Suspend the author of this item.",
  "queueBehaviour": "NO_CHANGE",
  "valueRequired": false,
  "freeText": false,
  "possibleValues": [
    {
      "value": "Spam"
    },
    {
      "value": "Offensive"
    },
    {
      "value": "Other"
    }
  ],
  "filterInQueueIds": [
    "60c9e1c0e4e7e1001c7a0e1d"
  ],
  "position": "ALL_QUEUES",
  "webhooks": [
    {
      "name": "Discord webhook",
      "url": "https://discord.com/webhook"
    }
  ]
}'
{
  "id": "60c9e1c0e4e7e1001c7a0e1d",
  "createdAt": "2023-06-16T14:00:00.000Z",
  "name": "Suspend author",
  "description": "Suspend the author of this item.",
  "queueBehaviour": "NO_CHANGE",
  "valueRequired": false,
  "freeText": false,
  "possibleValues": [
    {
      "value": "Spam"
    },
    {
      "value": "Offensive"
    },
    {
      "value": "Other"
    }
  ],
  "filterInQueueIds": [
    "60c9e1c0e4e7e1001c7a0e1d"
  ],
  "position": "ALL_QUEUES"
}

Authorizations

Authorization
string
headerrequired

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

Body

application/json
name
string
required

The name of the action.

description
string | null

The description of the action.

queueBehaviour
enum<string>
default: NO_CHANGE

Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.

Available options:
REMOVE,
ADD,
NO_CHANGE
filterInQueueIds
string[]

The IDs of the queues the action is available in.

position
enum<string>
default: ALL_QUEUES

Show the action in all queues, selected queues or no queues (to use via API only).

Available options:
ALL_QUEUES,
SOME_QUEUES,
HIDDEN
possibleValues
object[]

The possible values of the action. The user will be prompted to select one of these values when executing the action.

valueRequired
boolean
default: false

Whether the action requires a value to be executed.

freeText
boolean
default: false

Whether the action allows any text to be entered as a value or if it must be one of the possible values.

webhooks
object[]

The action's webhooks.

Response

200 - application/json
id
string
required

The ID of the action.

createdAt
string
required

The date the action was created.

name
string
required

The name of the action.

description
string | null

The description of the action.

queueBehaviour
enum<string>
default: NO_CHANGE

Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.

Available options:
REMOVE,
ADD,
NO_CHANGE
filterInQueueIds
string[]

The IDs of the queues the action is available in.

position
enum<string>
default: ALL_QUEUES

Show the action in all queues, selected queues or no queues (to use via API only).

Available options:
ALL_QUEUES,
SOME_QUEUES,
HIDDEN
possibleValues
object[]

The possible values of the action. The user will be prompted to select one of these values when executing the action.

valueRequired
boolean
default: false

Whether the action requires a value to be executed.

freeText
boolean
default: false

Whether the action allows any text to be entered as a value or if it must be one of the possible values.

Was this page helpful?