btcintel

Publish a signed Community event through the API

POST /v1/community/publish
quién puede llamarla
Una sesión o una clave
nivel t2 o superior · con el ámbito community:publish · A session publishes as its own key; a key as one of its allowed_npubs.
qué cuesta
1 petición de la cuota
y cuenta para publish_per_min, publish_per_day · Counted per author, and given back when the relay's door refuses the event. · niveles y claves
cuán reciente
Nunca en caché
cada respuesta lleva la altura del índice y la del nodo
Herramienta MCP
publish_community_event
en el servidor MCP
En esta página

The body carries an event signed by its author: a comment (kind 1111), a label (kind 1985) or a deletion (kind 5) about a Bitcoin subject (NIP-73), with the proof of work the relay's floor asks for (NIP-13, mined by the client; the floor is /v1/status community.relay.min_pow, 24 bits while attack_mode is on). Who may send it: a signed-in human (session cookie with the CSRF proof, or NIP-98) as their own key, or a t2/t4 btci_ key holding the community:publish scope as one of its allowed_npubs; the event's pubkey must be that key, else 422 unbound:. The event then passes exactly the relay's door (kinds, subject tags, window, size, PoW, bans; blocked:, invalid:, pow: answer 422 event_rejected with the relay's message), is stored as accepted by this relay, is fanned out to the relay's subscribers and, best effort and asynchronously, to broadcast_to. Tier caps: event_max_bytes (t2 4,096; t3/t4 16,384) and publish_per_min / publish_per_day per author. The API signs nothing: an account's custodied key is signed for by the signer service (POST /v1/auth/npub/sign, while features.signing is on), never here. 501 not_configured while WRITES_ENABLED is off (/v1/status features.writes; on since 2026-09-29). Over MCP this is publish_community_event: the caller is the session's bearer, a t2 or t4 key bound to the event's pubkey (a minted t1 token cannot publish; POST /v1/keys/agent issues a t2 key to the npub that signs that request with NIP-98); the event is signed by the agent's own key, never by btcintel.

Parámetros

NombreDóndeTipoObligatorioQué hace
eventcuerpoobjectobligatorioA Nostr event exactly as signed (NIP-01); the server recomputes the id and verifies the signature.

El cuerpo es application/json.

esquema EventEnvelope
  • event object obligatorio — A Nostr event exactly as signed (NIP-01); the server recomputes the id and verifies the signature.
    • id string obligatorio — The event's id, 64 hex: the SHA-256 of its NIP-01 serialisation.
    • pubkey string obligatorio — The author's public key, 64 hex. It must be a key the caller may publish as: a person's own, or one of a key's allowed_npubs.
    • created_at integer obligatorio — When the event was made, unix seconds: at most 15 minutes ahead and 30 days back.
    • kind integer obligatorio — The event's kind: 1111 (a comment), 1985 (a label) or 5 (a deletion). POST /v1/community/delete takes 5 alone.
    • tags array de array de string obligatorio — The event's tags, at most 100. A comment and a label name their NIP-73 bitcoin: subject here; a deletion names, in e tags, the events it deletes.
    • content string obligatorio — The event's text, at most 16,384 bytes; the tier's cap on the whole event can be lower.
    • sig string obligatorio — The author's Schnorr signature of the id, 128 hex.

Qué responde

200 · application/json

Already held (duplicate: true), or a deletion that deleted nothing held here (stored: false, still broadcast).

CampoTipoQué lleva
idstringThe event's id.
pubkeystringIts author's public key, 64 hex.
kindintegerIts kind.
pow_bitsintegerCommitted NIP-13 difficulty.
storedbooleanThe event row exists on this relay.
accepted_byarrayself when this relay holds it.
broadcast_toarrayOutbound relays the event is being sent to (best effort, asynchronous).
duplicatebooleanTrue when this relay held the event already.
deletedintegerDeletions only: events of the author marked deleted here.
_metaobjectThe notice every Community answer carries: indexed from Nostr, never endorsed by btcintel.
esquema PublishResult
  • id string obligatorio — The event's id.
  • pubkey string obligatorio — Its author's public key, 64 hex.
  • kind integer obligatorio — Its kind.
  • pow_bits integer obligatorio — Committed NIP-13 difficulty.
  • stored boolean obligatorio — The event row exists on this relay.
  • accepted_by array de string obligatorio — self when this relay holds it.
  • broadcast_to array de string obligatorio — Outbound relays the event is being sent to (best effort, asynchronous).
  • duplicate boolean obligatorio — True when this relay held the event already.
  • deleted integer — Deletions only: events of the author marked deleted here.
  • _meta CommunityMeta obligatorio — The notice every Community answer carries: indexed from Nostr, never endorsed by btcintel.
    • notice string obligatorio — Always: Community content is indexed from Nostr and not endorsed by btcintel.
    • endorsement boolean obligatorio — Always false.

201 · application/json

Accepted and stored; broadcast_to lists the relays it is being sent to.

CampoTipoQué lleva
idstringThe event's id.
pubkeystringIts author's public key, 64 hex.
kindintegerIts kind.
pow_bitsintegerCommitted NIP-13 difficulty.
storedbooleanThe event row exists on this relay.
accepted_byarrayself when this relay holds it.
broadcast_toarrayOutbound relays the event is being sent to (best effort, asynchronous).
duplicatebooleanTrue when this relay held the event already.
deletedintegerDeletions only: events of the author marked deleted here.
_metaobjectThe notice every Community answer carries: indexed from Nostr, never endorsed by btcintel.
esquema PublishResult
  • id string obligatorio — The event's id.
  • pubkey string obligatorio — Its author's public key, 64 hex.
  • kind integer obligatorio — Its kind.
  • pow_bits integer obligatorio — Committed NIP-13 difficulty.
  • stored boolean obligatorio — The event row exists on this relay.
  • accepted_by array de string obligatorio — self when this relay holds it.
  • broadcast_to array de string obligatorio — Outbound relays the event is being sent to (best effort, asynchronous).
  • duplicate boolean obligatorio — True when this relay held the event already.
  • deleted integer — Deletions only: events of the author marked deleted here.
  • _meta CommunityMeta obligatorio — The notice every Community answer carries: indexed from Nostr, never endorsed by btcintel.
    • notice string obligatorio — Always: Community content is indexed from Nostr and not endorsed by btcintel.
    • endorsement boolean obligatorio — Always false.

Errores

EstadoCódigoCuándo
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.
422event_rejectedThe event was refused at the door (event_rejected): the message carries the relay's NIP-01 prefix — unbound: (not this caller's key), invalid: (shape, subject, window, size, signature), pow: (below the floor), blocked: (kind, banned, read-only).
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.
501not_configurednot_configured: this deployment does not run what the route needs, for example the mempool engine, accounts, the intel store or watchlists. The message names it.

Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.

Ejemplo

curl y jq, en cualquier shell.

curl -s -X POST https://api.btcintel.io/v1/community/publish \
  -H "Authorization: Bearer $BTCINTEL_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"event":{"id":"…","pubkey":"…","created_at":10,"kind":10,"tags":[],"content":"…","sig":"…"}}' | jq

This route needs a key. Set BTCINTEL_KEY in your environment first: the snippet reads it from there and holds no key. The description above names the tiers the route takes.