---
title: "common.moderation-action@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/common.moderation-action"
updated: null
---

# common.moderation-action@1 · OpenVibe.Services

HTML: [common.moderation-action@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/common.moderation-action)

# ModerationAction `common.moderation-action@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: network
- Visibility: public
- Status: active
- Compatibility: backward
- Decision: [ADR-022](/docs/adr/ADR-022)
- Schema: [`https://openvibe.network/contracts/common/moderation-action.v1.json`](/docs/contracts/common.moderation-action.json)

common.moderation-action@1 (ADR-022, roadmap WS-D task 1): one staff or moderator action on someone else's content or account, as a service reports it to OpenVibe.Network's moderation audit log. The payload of every <service>.moderation.action event that has no older shape of its own (tools, games, wiki, blog, news, reviews, deals, coupons, trade, codes); modelled on community.moderation.action@1. Written to the service's outbox in the transaction that performs the action. A person acting on their own content is not moderation and is not reported. Envelope: subject { type: moderation\_action, id: <target type>:<target id> }, visibility internal, actor the staff member. Never carries the content itself, a secret or an address.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `action` | string | yes | A short verb id, as the service names it: <thing>.<what happened> (post.hidden, user.banned, release.revoked, guard.blocked). | - `pattern ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$`<br>- `minLength 1`<br>- `maxLength 64` |
| `target` | object | yes |  | - `no other fields` |
| `target.type` | string | yes | What was acted on, in the service's own words (post, page, release, user, player, …). | - `pattern ^[a-z][a-z0-9_]*$`<br>- `minLength 1`<br>- `maxLength 40` |
| `target.id` | string | yes |  | - `minLength 1`<br>- `maxLength 200` |
| `target.owner_subject` | string \| null |  | Whose content or account it was, when known. | - `maxLength 200` |
| `actor_subject` | string \| null | yes | The staff member or moderator (null only for a service acting without a person). | - `maxLength 200` |
| `reason` | string \| null |  |  | - `maxLength 500` |
| `details` | object |  | Per action: the fields changed, the previous and new state, a bulk action's count, … never the content. |  |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: minimal

~~~~
{
  "action": "user.banned",
  "target": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
~~~~

Valid: post-hidden

~~~~
{
  "action": "post.hidden",
  "target": {
    "type": "post",
    "id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPS",
    "owner_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "reason": "spam",
  "details": {
    "previous": "published",
    "now": "hidden"
  }
}
~~~~

Valid: service-actor

~~~~
{
  "action": "guard.blocked",
  "target": {
    "type": "address",
    "id": "ip:3f9a1c"
  },
  "actor_subject": null,
  "reason": null,
  "details": {
    "rule": "rate"
  }
}
~~~~

Rejected: action-not-an-id

~~~~
{
  "action": "Hid The Post",
  "target": {
    "type": "post",
    "id": "x"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
~~~~

Rejected: carries-content

~~~~
{
  "action": "post.hidden",
  "target": {
    "type": "post",
    "id": "x"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "content": "the post text"
}
~~~~

Rejected: no-actor

~~~~
{
  "action": "post.hidden",
  "target": {
    "type": "post",
    "id": "x"
  }
}
~~~~

Rejected: reason-too-long

~~~~
{
  "action": "post.hidden",
  "target": {
    "type": "post",
    "id": "x"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "reason": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
~~~~

Rejected: target-extra-field

~~~~
{
  "action": "post.hidden",
  "target": {
    "type": "post",
    "id": "x",
    "title": "Hello"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
~~~~

Rejected: target-without-id

~~~~
{
  "action": "post.hidden",
  "target": {
    "type": "post"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('common.moderation-action@1', value);   // { valid, errors: [{ path, message }] }
~~~~
