OpenRPC and JSON-RPC documentation with Try-It
JSON-RPC has no built-in way to explore an API: every endpoint is the same URL and the method lives in the request body. OpenRPC fixes that on paper, but you still need a place where developers can read the methods and call them. SelfDocHub renders OpenRPC specifications as browsable documentation and lets you execute requests right from the page.
Publish an OpenRPC document#
An OpenRPC document, recognised by its root openrpc field, is published with one HTTP call, like any other
specification:
curl -X POST https://docs.example.com/api/v1/services/ledger-rpc/spec \
-H "Authorization: Bearer $DOCS_UPLOAD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @openrpc.json
Each method becomes a page with its description, parameters, result and error definitions and examples. In the merged
documentation methods are prefixed with the service slug (ledger-rpc.getBalance), so identically named methods of
different services never collide.
Try-It for JSON-RPC#
The endpoint page includes a Try-It panel. It builds the JSON-RPC envelope for the method, lets you edit the parameters, sends the request to the environment you select and shows the response with status, headers and timing. You can copy the request as code in curl, Go, Python, JavaScript, PHP or C#.
Environments are named targets with a base URL, headers and timeouts. Create them once, share the public ones with the team and keep credentials out of chat messages. An administrator decides which environments an AI client may use.
Save and share#
- Saved requests keep the parameters you tuned for later.
- Share by link gives a colleague the same request in one click.
- Interactions store a complete request and response pair, which is handy for bug reports and for examples in a text page.
These are private to the user who created them unless shared by link.
History and notifications#
Every publish is a version with a change log, so you can see which methods were added, removed or changed and which changes break clients. Notifications by webhook, email, Telegram or Slack can announce new versions or only breaking ones.
Next to the rest of your APIs#
OpenRPC services share the portal with OpenAPI, GraphQL and AsyncAPI ones, with the same teams, roles, search and exports. If your company has both REST and JSON-RPC services, developers no longer need to remember where each one is documented.
