Every Seed site (hyper.media, dev.hyper.media or a self-hosted domain) serves the same HTTP read API. Seed Exact reads documents, accounts, listings and comments from it without authentication. This page lists exactly what the app uses; it is not a full reference of the API. Writes are covered in Publishing signed blobs.
Which server
The base URL is the root contract's persisted server state, default https://hyper.media, chosen in Me. A document opened by a typed web address is read from that address's origin instead (Open a site by URL). The net.fetch https: grant in app.ts allows any HTTPS host (Grants and capabilities).
Request and response format
GET {server}/api/{Key}?{params}, built by apiUrl. String, number and boolean parameters are written as is; objects and arrays are JSON-encoded into the query string.
Header Accept: application/json. Deadline 15 s (exactTimeout: 15000).
The body is a superjson envelope {json, meta}. The app decodes it with its own decodeEnvelope, which supports dates, bigint, undefined, special numbers and Uint8Array, and rejects anything else.
/hm/api/config answers plain JSON.
Endpoints
Endpoint | Parameters | Fields the app reads | Callers |
|---|---|---|---|
| none |
|
|
|
|
| |
|
|
| |
|
|
|
|
|
|
| child lists and author documents ( |
|
|
| |
|
|
| |
|
|
| |
|
| image bytes |
|
| none | raw file |
|
Shapes worth knowing
Document (Resource with type: "document"): content (block nodes), metadata {name, summary, icon, cover}, authors (uids), updateTime, version (head CIDs joined with dots), and for profile publishing account, path, genesis, generationInfo.generation.
Redirect: redirectTarget is an hm URL string or an object with id. The reader follows up to 10 hops.
Document info (Query and QueryBlock results): id {uid, path, id}, path, metadata {name, summary, cover, icon}, updateTime, authors, visibility, firstImageInContent, activitySummary.commentCount. Private results (visibility of 2, PRIVATE or RESOURCE_VISIBILITY_PRIVATE) are dropped by the app.
Comment: id (author/tsid), version, author, targetAccount, targetPath, replyParent, threadRoot, threadRootVersion, content, createTime, visibility. See Discuss: threading logic.
targetId for ListComments: {id, uid, path, version: null, blockRef: null, blockRange: null, hostname: null, scheme: null, latest: true}, in that key order.
Times arrive as ISO strings, Date (through superjson), numbers or {seconds, nanos}; the app accepts all four.
Error handling
client.ts maps failures to three messages: Couldn't reach the server., The server answered {status}. and The server sent something unreadable. Loaders turn them into pages with an error field and a Retry button, and never cache a failure. There is no automatic retry.
The Me package does not use this client. It calls /api/Account (8 s deadline) and /hm/api/config (10 s deadline) through its own helper (src/me/sources.ts L64, L125).
In tests
Contract tests for read and discuss call the live https://hyper.media read-only; write tests use https://dev.hyper.media (Contract UI tests).
The local test server on http://127.0.0.1:4790 forwards GET /hm/โฆ and GET /api/โฆ to https://hyper.media, answers /hm/api/config from the mock notify service, and never proxies notify paths.
Bun tests mock fetch and replay captured answers from src/read/__tests__/fixtures/ and src/discuss/__tests__/hypermedia-home-comments.json (Bun unit tests).
Known limits
No paging on Query, QueryBlock (capped client-side at the block's limit or 50) or ListComments.
No search endpoint is used. The directory search filters titles on the device.
The read, discuss and profile loaders do not verify signatures of what they read; they trust the chosen server.
User stories
The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).
US-READ-01 Open the app to my site's home: GET /hm/api/config (registeredAccountUid) and /api/Resource
US-READ-02 Read a document: /api/Resource, /api/Account, /api/ResourceMetadata and the image endpoint
US-READ-03 Follow links between documents: /api/Resource (with redirects) and /api/ResourceMetadata for mention names
US-READ-04 Open a Seed site by URL: GET /hm/api/config to find the site's home account
US-READ-05 Open an hm:// link from outside the app: /api/Resource for the document, /hm/api/config for site URLs
US-READ-06 Keep reading another site in place: The same read endpoints, asked of another origin
US-READ-07 Browse and search a space's documents: /api/Query with mode AllDescendants, /api/Account for the space name
US-READ-08 See the documents under and inside a document: /api/Query (Children), /api/QueryBlock, /api/Resource, /api/Account
US-READ-09 See who wrote a document and visit their profile: /api/Account and /api/Query (Children of the account)
US-READ-10 Refresh a page and recover from a failed load: The redirect, not-found and document answers of /api/Resource
US-READ-11 Share a document: The site's /hm/<uid>/<path> web address
US-DISC-01 See the discussion on a document: The ListComments call
US-DISC-02 Read a thread: Resource, ResourceMetadata and ListComments
US-DISC-03 Comment on a document: Resource for the document version
US-ID-03 Switch between my identities: The Account read that supplies profile names and icons
US-ID-07 Edit my public profile: Account, Resource and ListChanges reads before and after the write
US-ID-08 Choose which Seed server I read from: The /hm/api/config check and what the server is then used for
US-APP-09 Know the app only reaches what it must: Public reads with no identity
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime