Publish a signed Community event through the API
POST /v1/community/publish- who may call it
- A session or a key
- tier t2 or above · with the scope
community:publish· A session publishes as its own key; a key as one of itsallowed_npubs. - what it costs
- 1 request of the quota
- and counts toward
publish_per_min,publish_per_day· Counted per author, and given back when the relay's door refuses the event. · tiers and keys - how fresh
- Never cached
- every answer carries the index's height and the node's
On this page
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.
Parameters
| Name | Where | Type | Required | What it does |
|---|---|---|---|---|
event | body | object | required | A Nostr event exactly as signed (NIP-01); the server recomputes the id and verifies the signature. |
The body is application/json.
schema EventEnvelope
eventobject required — A Nostr event exactly as signed (NIP-01); the server recomputes the id and verifies the signature.idstring required — The event's id, 64 hex: the SHA-256 of its NIP-01 serialisation.pubkeystring required — 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'sallowed_npubs.created_atinteger required — When the event was made, unix seconds: at most 15 minutes ahead and 30 days back.kindinteger required — The event's kind: 1111 (a comment), 1985 (a label) or 5 (a deletion).POST /v1/community/deletetakes 5 alone.tagsarray of array of string required — The event's tags, at most 100. A comment and a label name their NIP-73bitcoin:subject here; a deletion names, inetags, the events it deletes.contentstring required — The event's text, at most 16,384 bytes; the tier's cap on the whole event can be lower.sigstring required — The author's Schnorr signature of the id, 128 hex.
What it answers
200 · application/json
Already held (duplicate: true), or a deletion that deleted nothing held here (stored: false, still broadcast).
| Field | Type | What it carries |
|---|---|---|
id | string | The event's id. |
pubkey | string | Its author's public key, 64 hex. |
kind | integer | Its kind. |
pow_bits | integer | Committed NIP-13 difficulty. |
stored | boolean | The event row exists on this relay. |
accepted_by | array | self when this relay holds it. |
broadcast_to | array | Outbound relays the event is being sent to (best effort, asynchronous). |
duplicate | boolean | True when this relay held the event already. |
deleted | integer | Deletions only: events of the author marked deleted here. |
_meta | object | The notice every Community answer carries: indexed from Nostr, never endorsed by btcintel. |
schema PublishResult
idstring required — The event's id.pubkeystring required — Its author's public key, 64 hex.kindinteger required — Its kind.pow_bitsinteger required — Committed NIP-13 difficulty.storedboolean required — The event row exists on this relay.accepted_byarray of string required —selfwhen this relay holds it.broadcast_toarray of string required — Outbound relays the event is being sent to (best effort, asynchronous).duplicateboolean required — True when this relay held the event already.deletedinteger — Deletions only: events of the author marked deleted here._metaCommunityMeta required — The notice every Community answer carries: indexed from Nostr, never endorsed by btcintel.noticestring required — Always: Community content is indexed from Nostr and not endorsed by btcintel.endorsementboolean required — Always false.
201 · application/json
Accepted and stored; broadcast_to lists the relays it is being sent to.
| Field | Type | What it carries |
|---|---|---|
id | string | The event's id. |
pubkey | string | Its author's public key, 64 hex. |
kind | integer | Its kind. |
pow_bits | integer | Committed NIP-13 difficulty. |
stored | boolean | The event row exists on this relay. |
accepted_by | array | self when this relay holds it. |
broadcast_to | array | Outbound relays the event is being sent to (best effort, asynchronous). |
duplicate | boolean | True when this relay held the event already. |
deleted | integer | Deletions only: events of the author marked deleted here. |
_meta | object | The notice every Community answer carries: indexed from Nostr, never endorsed by btcintel. |
schema PublishResult
idstring required — The event's id.pubkeystring required — Its author's public key, 64 hex.kindinteger required — Its kind.pow_bitsinteger required — Committed NIP-13 difficulty.storedboolean required — The event row exists on this relay.accepted_byarray of string required —selfwhen this relay holds it.broadcast_toarray of string required — Outbound relays the event is being sent to (best effort, asynchronous).duplicateboolean required — True when this relay held the event already.deletedinteger — Deletions only: events of the author marked deleted here._metaCommunityMeta required — The notice every Community answer carries: indexed from Nostr, never endorsed by btcintel.noticestring required — Always: Community content is indexed from Nostr and not endorsed by btcintel.endorsementboolean required — Always false.
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. |
| 422 | event_rejected | The 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). |
| 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. |
| 501 | not_configured | not_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. |
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/community/publish \
-H "Authorization: Bearer $BTCINTEL_KEY" \
-H 'Content-Type: application/json' \
-d '{"event":{"id":"…","pubkey":"…","created_at":10,"kind":10,"tags":[],"content":"…","sig":"…"}}' | jqThis 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.