Execute an action
POST/v1/actions/{key}/executeKey scope write
Executes an action on a moderation or on an author and records it in the action log. The built-in author actions change the author's status; for an action of your own Infrared applies the queue behaviour, writes the log and emits action.executed, which is your signal to act. When the moderation has a review queue item, the action's queue_behavior is applied to it.
Needs a key with the write scope. Authentication
Path parameters
keystringRequiredKey of the action, for example
reject,block_authoror the key of a custom action.
Request body
moderation_idstringId of the moderation to act on:
mod_plus 22 base62 characters. Required for an action whosetargetiscontent.author_idstringYour id for the author to act on, up to 200 characters. Required for an action whose
targetisauthor, unlessmoderation_idnames a moderation that has an author. An unknown id creates the author.valueanyA value passed to the action, of any JSON type. Only actions with
accepts_valueset to true take one. The built-inblock_authorandsuspend_authorread a reason string, or an object withreasonanduntil(ISO 8601).notestringA note of up to 4,000 characters, stored in the action log and, when the moderation has a review queue item, on that item.
Returns
The action log entry, with status 201.
- 201 CreatedAn action log object
Errors
- 404
not_foundThe project has no action with this key, or no moderation with this id.
- 409
action_disabledThe action is disabled.
- 422
validation_errorA content action was called without
moderation_id, an author action without an author,valuewas sent to an action that does not accept one, ormoderation_idis not amod_id.
Every endpoint can also answer the errors any request can meet: a missing key, a rate limit, a malformed body. Errors
Something missing or unclear on this page? Write to support@useinfrared.com.