Seed site read API
The read endpoints of a Seed site that the mobile app calls: paths, parameters, the response fields the app uses, and which module calls each.

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

GET /hm/api/config

none

registeredAccountUid, notifyServiceUrl, notifyServiceHost

siteHomeUid, resolveNotifyUrl, the server check in Me

GET /api/Resource

id=hm://uid/path

type (document, comment, redirect, not-found, others), document, comment, redirectTarget

fetchDocument, fetchComment and postComment, publishProfile

GET /api/ResourceMetadata

id=hm://uid/path

metadata.name

mention names in load.ts, thread document titles in discuss

GET /api/Account

id=uid

type (account, account-not-found), metadata.name, metadata.icon, metadata.summary, id.version

accountMeta and loadAuthor, loadProfile and the publish confirmation, profile names in Me

GET /api/Query

includes=[{space, path, mode}]

results[] (document infos)

child lists and author documents (mode: "Children"), the directory (mode: "AllDescendants") in read

GET /api/QueryBlock

query= the Query block's own attributes.query object

results[], accountsMetadata, interactionSummaries[id].comments

queryItems

GET /api/ListComments

targetId= an unpacked id object

comments[], authors

listComments

GET /api/ListChanges

targetId=hm://account

latestVersion, changes[] {id, deps}

publishProfile

GET /hm/api/image/{cid}

size=S, M or L

image bytes

mediaUrl, used as image sources

GET /ipfs/{cid}

none

raw file

mediaUrl with no size (video and file links)

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.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime