Change the relay's write policy (ops, human admin)
PATCH /v1/ops/relay/policy- quién puede llamarla
- Un operador
- una persona:
admin - cuán reciente
- Nunca en caché
- cada respuesta lleva la altura del índice y la del nodo
- Herramienta MCP
- Ninguna
En esta página
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.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
write_enabled | cuerpo | boolean | opcional | Open the relay to writes, or close it. |
min_pow_difficulty | cuerpo | integer | opcional | The new proof-of-work floor, in bits: 0 to 64. |
attack_mode | cuerpo | boolean | opcional | Turn attack mode on or off. On, the effective floor is at least 24. |
moderation_reasons | cuerpo | array | opcional | The words a moderation may give as its reason, in place of the list in force; legal:<reference> and other:<text> stay open. |
El cuerpo es application/json.
esquema RelayPolicyPatch
write_enabledboolean — Open the relay to writes, or close it.min_pow_difficultyinteger — The new proof-of-work floor, in bits: 0 to 64. · ≥ 0 · ≤ 64attack_modeboolean — Turn attack mode on or off. On, the effective floor is at least 24.moderation_reasonsarray de string — The words a moderation may give as its reason, in place of the list in force;legal:<reference>andother:<text>stay open.
Qué responde
The policy after the change.
| Campo | Tipo | Qué lleva |
|---|---|---|
write_enabled | boolean | False until the posting policy is signed off. |
min_pow_difficulty | integer | The proof-of-work floor the policy sets, in bits. Attack mode can raise the effective floor. |
attack_mode | boolean | Raises the effective floor to 24 bits. |
floor | integer | The effective minimum difficulty the door enforces. |
moderation_reasons | array | The vocabulary a moderation reason must come from; legal:<reference> and other:<text> are always accepted. |
updated_at | string | When the policy last changed. |
updated_by | string o null | operator:<id> of the last change. |
esquema RelayPolicy
write_enabledboolean obligatorio — False until the posting policy is signed off.min_pow_difficultyinteger obligatorio — The proof-of-work floor the policy sets, in bits. Attack mode can raise the effectivefloor. · ≥ 0 · ≤ 64attack_modeboolean obligatorio — Raises the effective floor to 24 bits.floorinteger obligatorio — The effective minimum difficulty the door enforces.moderation_reasonsarray de string — The vocabulary a moderation reason must come from;legal:<reference>andother:<text>are always accepted.updated_atstring (date-time) obligatorio — When the policy last changed.updated_bystring | null —operator:<id>of the last change.
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 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. |
| 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. |
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 PATCH https://api.btcintel.io/v1/ops/relay/policy \
-H "Authorization: Bearer $BTCINTEL_KEY" \
-H 'Content-Type: application/json' \
-d '{}' | jqThis 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.