btcintel

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: admin or moderator
what it costs
1 request of the quota
tiers and keys
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

NameWhereTypeRequiredWhat it does
actionbodystringrequiredWhat to do: hide or unhide an event (event_id), ban or unban a pubkey (pubkey).
event_idbodystringoptionalThe event to hide or unhide (64 hex or note1…).
pubkeybodystringoptionalThe pubkey to ban or unban (64 hex or npub1…).
reasonbodystringrequiredOne of the policy's moderation_reasons, or legal:<reference>, or other:<text>.

The body is application/json.

schema ModerationBody
  • action string required — What to do: hide or unhide an event (event_id), ban or unban a pubkey (pubkey). · one of "hide", "unhide", "ban", "unban"
  • event_id string — The event to hide or unhide (64 hex or note1…).
  • pubkey string — The pubkey to ban or unban (64 hex or npub1…).
  • reason string required — One of the policy's moderation_reasons, or legal:<reference>, or other:<text>. · at most 500 characters

What it answers

201 · application/json

The row appended.

FieldTypeWhat it carries
idintegerThe moderation's id.
actionstringWhat was done: an event hidden or shown again, a pubkey banned or unbanned.
event_idstring64 hex characters (hide/unhide).
pubkeystring64 hex characters (ban/unban).
npubstring or nullThe pubkey as an npub. Only on a ban or an unban.
reasonstringWhy: a word of the policy's vocabulary, legal:<reference> or other:<text>.
actorstringoperator:<id>.
atstringWhen it was done.
schema Moderation
  • id integer required — The moderation's id.
  • action string required — What was done: an event hidden or shown again, a pubkey banned or unbanned. · one of "hide", "unhide", "ban", "unban"
  • event_id string — 64 hex characters (hide/unhide).
  • pubkey string — 64 hex characters (ban/unban).
  • npub string | null — The pubkey as an npub. Only on a ban or an unban.
  • reason string required — Why: a word of the policy's vocabulary, legal:<reference> or other:<text>.
  • actor string required — operator:<id>.
  • at string (date-time) required — When it was done.

Errors

StatusCodeWhen
400invalid_inputMalformed input (invalid_input).
401unauthorizedunauthorized: 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.
403forbiddenforbidden: 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.
404not_foundNo such event, or an unban of a pubkey that is not banned (not_found).
429quota_exceededquota_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":"…"}' | jq

This 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.