Social API reference

Social API · Moderation-Admin

post/v1/workspaces/{workspace_id}/communities/{community_id}/moderation/actionsAuth

Apply a moderation action directly, without a preceding flag (task 017). Acts on any target — post/comment (status), direct_message (moderator soft-delete), or actor (ban=suspend / restore=reinstate). Writes a flag_id=null audit row.

Path parameters

workspace_id*string · uuid

Id of the workspace.

community_id*string · uuid

Id of the community.

Headers

Idempotency-Keystring

Opaque client-generated string used to deduplicate retries within a 24h window. Replays return the original response; same key + different body returns 409 `IDEMPOTENCY_KEY_REUSE`.

Request body

target_kind*enum (4)

What the action targets (task 017). post/comment → status transition; direct_message → moderator soft-delete; actor → ban=suspend / restore=reinstate.

Example: "direct_message"

target_id*string · uuid

The target UUID (post/comment/actor/message id per target_kind).

Example: "bbbbbbbb-0000-0000-0000-000000000001"

action*enum (7)

Action. hide/remove act on the target; ban/restore suspend/reinstate an actor; warn is audit-only. The audit row has flag_id=null (unsolicited action).

Example: "remove"

notesstring

Optional moderator notes (up to 2000 chars).

Response · 201 Action recorded (flag_id=null audit row); side-effect applied.

id*string · uuid

Action UUID.

Example: "eeeeeeee-0000-0000-0000-000000000001"

community_id*string · uuid

Owning community UUID.

Example: "cccccccc-cccc-cccc-cccc-cccccccccccc"

flag_id*string · uuid

Flag UUID this action was applied to.

Example: "ffffffff-0000-0000-0000-000000000001"

target_kind*object

What the action targeted.

Example: "post"

target_id*string · uuid

UUID of the post, comment, actor or message acted on. Null when that target has since been deleted — the record of a moderator's decision outlives the content it was about.

Example: "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"

moderator_account_id*string · uuid

PlatformUser account UUID of the moderator.

Example: "99999999-0000-0000-0000-000000000001"

action*object

Action applied.

Example: "hide"

notes*string

Optional moderator notes.

Example: "Spam confirmed."

created_at*string · date-time

ISO timestamp the action was recorded.

Example: "2026-05-01T12:00:00.000Z"

Example

Request

POST https://social.productcraft.co/v1/workspaces/{workspace_id}/communities/{community_id}/moderation/actions
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "target_kind": "direct_message",
  "target_id": "bbbbbbbb-0000-0000-0000-000000000001",
  "action": "remove",
  "notes": "string"
}

Response

{
  "id": "eeeeeeee-0000-0000-0000-000000000001",
  "community_id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
  "flag_id": "ffffffff-0000-0000-0000-000000000001",
  "target_kind": "post",
  "target_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
  "moderator_account_id": "99999999-0000-0000-0000-000000000001",
  "action": "hide",
  "notes": "Spam confirmed.",
  "created_at": "2026-05-01T12:00:00.000Z"
}