Authorization: Bearer header.
Things to know before you call:
- Every method is a GET, including
posts.deleteandtags.delete. That is how linkhut works, so a destructive call looks identical on the wire to a read. The plugin marks the deletes destructive and never replays them after a network failure or a 5xx. - Writes can fail at HTTP 200. A write answers
{ "result_code": "done" }. The documented failure is{ "result_code": "something went wrong" }, which arrives with a 200 status. The plugin raises it as core’sApiError(status 200, the body attached) instead of returning it, so a failed write never looks like a success. posts.addcreates;replace: 'yes'updates. Withoutreplace, adding a url that is already saved fails. Withreplace: 'yes'the saved bookmark is rewritten: every field you leave out is reset (extendedandtagsempty, public, read), anddtis ignored. Only an update is retried after a 5xx or a dropped connection; a create may already have landed.- Etiquette. The docs ask for at least one second between requests and an
identifiable User-Agent; the plugin does both. A 500 or an HTTP 999 means you
were throttled. The plugin retries reads with backoff, starting at one
second. A 429 is retried by core three times, honouring
Retry-After. - Paging.
posts.allpages by offset: it takesstartandresults(default 1000, maximum 100000) andfromdt/todtbounds, and the plugin derivesnextStart, null on the last page.posts.recenthas no offset.posts.allHasheslists every bookmark as a URL MD5 and a change signature, so a sync can fetch only what changed (byhashesinposts.get). - No notes. linkhut implements the Pinboard posts and tags methods only; Pinboard’s notes and user routes do not exist on ln.ht.
- Webhooks. The plugin does not receive webhooks; linkhut sends none.
- 12 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Linkhut API key before the first call: More: API Key
pnpm corsair setup --plugin=linkhut --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Read the five most recent bookmarksWhat’s next
API reference
Every
linkhut.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.