NIP-86 management

The JSON-RPC management API: moderation, access lists, relay identity and roles, with Bearer or NIP-98 authentication.

Enabling

NIP-86 is a JSON-RPC API for managing the relay. It needs one of two authentication methods, otherwise every call is refused:

MethodSetup
Bearer tokenSet rpc.management_token and send Authorization: Bearer <token>
NIP-98Set rpc.admin_pubkey and send a NIP-98 auth event (kind 27235) signed by the admin key in Authorization: Nostr <base64> — a payload tag is required; each event is single-use within its 60-second window

Calling the API

POST / with Content-Type: application/nostr+json+rpc:

sh
curl -X POST http://127.0.0.1:8080/ \
  -H "Content-Type: application/nostr+json+rpc" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"method":"supportedmethods","params":[]}'

Methods

MethodParamsDescription
supportedmethods[]List of supported methods
banpubkey["pubkey", "reason (optional)"]Ban a pubkey from posting
unbanpubkey["pubkey"]Unban a pubkey
listbannedpubkeys[]List banned pubkeys and reasons
allowpubkey["pubkey", "reason (optional)"]Add to the allowlist (also un-bans)
unallowpubkey["pubkey"]Remove from the allowlist
listallowedpubkeys[]List the allowlist
allowkind / disallowkind[kind]Allow / disallow a kind
listallowedkinds[]List allowed kinds
changerelayname / changerelaydescription / changerelayicon["new value"]Change the relay name / description / icon (persisted to the config file)
createrole / editrole / deleterole[id, label, description, color, order]NIP-43 role management
assignrole / unassignrole["pubkey", "role id"]Assign / unassign a role
blockip / unblockip["ip", "reason (optional)"]Block / unblock an IP (blocking also drops existing connections)
listblockedips[]List blocked IPs
banevent / allowevent["event id", "reason (optional)"]Ban / unban an event
listbannedevents[]List banned events
listeventsneedingmoderation[]Events awaiting moderation (always empty on this relay)
Served on the public POST / routes
The NIP-86 RPC is mounted on the relay's public POST / routes. Mutations are recorded in a rate-limited audit log (at most 600 entries per minute) with the authenticated identity. Requests over rpc.max_admin_body_bytes are refused with 413.