POST
/
actions
curl --request POST \
  --url https://moderationapi.com/api/v1/actions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "name": "<string>",
  "description": "<string>",
  "queueBehaviour": "NO_CHANGE",
  "filterInQueueIds": [],
  "position": "ALL_QUEUES",
  "possibleValues": [],
  "valueRequired": false,
  "freeText": false,
  "webhooks": []
}'
{
  "id": "<string>",
  "key": "<string>",
  "createdAt": "<string>",
  "name": "<string>",
  "description": "<string>",
  "queueBehaviour": "NO_CHANGE",
  "filterInQueueIds": [],
  "position": "ALL_QUEUES",
  "possibleValues": [],
  "valueRequired": false,
  "freeText": false
}

Authorizations

Authorization
string
header
required

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.

key
string | null

User defined key 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
Action created successfully
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.

queueBehaviour
enum<string>
default:
NO_CHANGE
required

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[]
required

The IDs of the queues the action is available in.

position
enum<string>
default:
ALL_QUEUES
required

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[]
required

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
required

Whether the action requires a value to be executed.

freeText
boolean
default:
false
required

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

key
string | null

User defined key of the action.

description
string | null

The description of the action.

Was this page helpful?