btcintel

Change the relay's write policy (ops, human admin)

PATCH /v1/ops/relay/policy
who may call it
An operator
a human: admin
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

Any subset of write_enabled, min_pow_difficulty (0–64) and attack_mode. The relay applies the change at once; the change is audited under access.relay_policy.

Parameters

NameWhereTypeRequiredWhat it does
write_enabledbodybooleanoptionalOpen the relay to writes, or close it.
min_pow_difficultybodyintegeroptionalThe new proof-of-work floor, in bits: 0 to 64.
attack_modebodybooleanoptionalTurn attack mode on or off. On, the effective floor is at least 24.
moderation_reasonsbodyarrayoptionalThe words a moderation may give as its reason, in place of the list in force; legal:<reference> and other:<text> stay open.

The body is application/json.

schema RelayPolicyPatch
  • write_enabled boolean — Open the relay to writes, or close it.
  • min_pow_difficulty integer — The new proof-of-work floor, in bits: 0 to 64. · ≥ 0 · ≤ 64
  • attack_mode boolean — Turn attack mode on or off. On, the effective floor is at least 24.
  • moderation_reasons array of string — The words a moderation may give as its reason, in place of the list in force; legal:<reference> and other:<text> stay open.

What it answers

The policy after the change.

FieldTypeWhat it carries
write_enabledbooleanFalse until the posting policy is signed off.
min_pow_difficultyintegerThe proof-of-work floor the policy sets, in bits. Attack mode can raise the effective floor.
attack_modebooleanRaises the effective floor to 24 bits.
floorintegerThe effective minimum difficulty the door enforces.
moderation_reasonsarrayThe vocabulary a moderation reason must come from; legal:<reference> and other:<text> are always accepted.
updated_atstringWhen the policy last changed.
updated_bystring or nulloperator:<id> of the last change.
schema RelayPolicy
  • write_enabled boolean required — False until the posting policy is signed off.
  • min_pow_difficulty integer required — The proof-of-work floor the policy sets, in bits. Attack mode can raise the effective floor. · ≥ 0 · ≤ 64
  • attack_mode boolean required — Raises the effective floor to 24 bits.
  • floor integer required — The effective minimum difficulty the door enforces.
  • moderation_reasons array of string — The vocabulary a moderation reason must come from; legal:<reference> and other:<text> are always accepted.
  • updated_at string (date-time) required — When the policy last changed.
  • updated_by string | null — operator:<id> of the last change.

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.
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 PATCH https://api.btcintel.io/v1/ops/relay/policy \
  -H "Authorization: Bearer $BTCINTEL_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}' | 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.