NIPs nostr improvement proposals

NIP-86 - Relay Management API

Table of Contents

Relay Management API

draft optional

Relays may provide an API for performing management tasks. This is made available as a JSON-RPC-like request-response protocol over HTTP, on the same URI as the relay's websocket.

When a relay receives an HTTP(s) request with a Content-Type header of application/nostr+json+rpc to a URI supporting WebSocket upgrades, it should parse the request as a JSON document with the following fields:

{
"method": "<method-name>",
"params": ["<array>", "<of>", "<parameters>"]
}

Then it should return a response in the format

{
"result": {"<arbitrary>": "<value>"},
"error": "<optional error message, if the call has errored>"
}

This is the list of methods that may be supported:

Authorization

The request must contain an Authorization header with a valid NIP-98 event, except the payload tag is required. The u tag is the relay URL.

If Authorization is not provided or is invalid, the endpoint should return a 401 response.