Social API reference

Social API · Moderation-Admin

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

Apply a moderation action to a flag. Records an audit entry and updates the target post/comment status. Pass an `Idempotency-Key` header so a retried request records ONE audit entry, not two.

Path parameters

workspace_id*string · uuid

Id of the workspace.

community_id*string · uuid

Id of the community.

flag_id*string · uuid

Id of the flag.

Headers

Idempotency-Keystring

Opaque client-generated string (1–256 chars, `[A-Za-z0-9._:-]`) used to deduplicate retries within a 24h window. Replays return the original response with `Idempotent-Replay: true`; same key + different body returns 409 `IDEMPOTENCY_KEY_REUSE`.

Request body

action*enum (7)

Action to apply. `hide`/`remove` transition target status; `unhide`/`restore` reverse them. `warn`/`ban` are audit-only — they record the decision without touching the target; for actor-level enforcement use PATCH `/actors/:actor_id` with `status=suspended` or the shadow-ban endpoints on this controller. `dismiss` closes the flag with no target change.

Example: "hide"

notesstring

Optional moderator notes attached to the audit row (up to 2000 chars).

Example: "Spam confirmed by manual review."

Response · 201 Action recorded; target status updated where applicable. Returns the updated flag and the audit row.

flag*object

The flag after the action (status flipped to actioned/dismissed for punitive/dismiss actions; reversals re-resolve it too).

moderation_action*object

The audit row this action recorded.

Example

Request

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

{
  "action": "hide",
  "notes": "Spam confirmed by manual review."
}

Response

{
  "flag": {},
  "moderation_action": {}
}