Hide or unhide an event, ban or unban a pubkey (ops, human admin or moderator)
POST /v1/ops/community/moderation- who may call it
- An operator
- a human:
adminormoderator - how fresh
- Never cached
- every answer carries the index's height and the node's
- MCP tool
- None
On this page
Appends a row to the lens and applies it — hidden events and banned pubkeys' events leave every public read and the relay at once; nothing is deleted. Ids may be 64 hex characters or NIP-19 (note1…, npub1…). A pubkey never seen can be banned ahead of its first event. The vocabulary of reasons is the relay policy's moderation_reasons.
Parameters
| Name | Where | Type | Required | What it does |
|---|---|---|---|---|
action | body | string | required | What to do: hide or unhide an event (event_id), ban or unban a pubkey (pubkey). |
event_id | body | string | optional | The event to hide or unhide (64 hex or note1…). |
pubkey | body | string | optional | The pubkey to ban or unban (64 hex or npub1…). |
reason | body | string | required | One of the policy's moderation_reasons, or legal:<reference>, or other:<text>. |
The body is application/json.
schema ModerationBody
actionstring required — What to do:hideorunhidean event (event_id),banorunbana pubkey (pubkey). · one of "hide", "unhide", "ban", "unban"event_idstring — The event to hide or unhide (64 hex or note1…).pubkeystring — The pubkey to ban or unban (64 hex or npub1…).reasonstring required — One of the policy'smoderation_reasons, orlegal:<reference>, orother:<text>. · at most 500 characters
What it answers
201 · application/json
The row appended.
| Field | Type | What it carries |
|---|---|---|
id | integer | The moderation's id. |
action | string | What was done: an event hidden or shown again, a pubkey banned or unbanned. |
event_id | string | 64 hex characters (hide/unhide). |
pubkey | string | 64 hex characters (ban/unban). |
npub | string or null | The pubkey as an npub. Only on a ban or an unban. |
reason | string | Why: a word of the policy's vocabulary, legal:<reference> or other:<text>. |
actor | string | operator:<id>. |
at | string | When it was done. |
schema Moderation
idinteger required — The moderation's id.actionstring required — What was done: an event hidden or shown again, a pubkey banned or unbanned. · one of "hide", "unhide", "ban", "unban"event_idstring — 64 hex characters (hide/unhide).pubkeystring — 64 hex characters (ban/unban).npubstring | null — The pubkey as an npub. Only on a ban or an unban.reasonstring required — Why: a word of the policy's vocabulary,legal:<reference>orother:<text>.actorstring required —operator:<id>.atstring (date-time) required — When it was done.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 401 | unauthorized | unauthorized: the request does not say who makes it, or what it offers does not verify: no key or session where one is needed, or a password, a code, a passkey or a signed event that does not check. The message says what is missing. |
| 403 | forbidden | forbidden: the caller is known but may not do this: a key without the scope or the tier the action needs, a session without an npub, a second factor or a recent sign-in, an operator without the role or switched off, or a source that does not allow it. The message says which. |
| 404 | not_found | No such event, or an unban of a pubkey that is not banned (not_found). |
| 429 | quota_exceeded | quota_exceeded: the caller's tier ran out of requests for the minute or the day. Retry-After says when to try again; every rate-limited answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead and X-RateLimit-Policy: log-only is set. |
Each comes in the one error envelope, and none is cached: an error carries Cache-Control: no-store.
Example
curl and jq, in any shell.
curl -s -X POST https://api.btcintel.io/v1/ops/community/moderation \
-H "Authorization: Bearer $BTCINTEL_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"hide","reason":"…"}' | jqThis route needs an operator credential. Set BTCINTEL_KEY to the ops bearer or a btci_ key with the ops:agent scope first: the snippet reads it from there and holds no key.