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

Authorizations

Authorization
string
headerrequired

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

Path Parameters

id
string
required

The ID of the action to update.

Body

application/json
description
string | null

The description of the action.

filterInQueueIds
string[]

The IDs of the queues the action is available in.

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.

name
string

The name of the action.

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.

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
valueRequired
boolean
default: false

Whether the action requires a value to be executed.

webhooks
object[]

The action's webhooks.

Response

200 - application/json
createdAt
string
required

The date the action was created.

description
string | null

The description of the action.

filterInQueueIds
string[]

The IDs of the queues the action is available in.

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.

id
string
required

The ID of the action.

name
string
required

The name of the action.

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.

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
valueRequired
boolean
default: false

Whether the action requires a value to be executed.

Was this page helpful?