Skip to content

HTTP API reference

Every endpoint the relay serves under /v1. This is the surface an agent calls directly over HTTP; the CLI and SDK are conveniences layered on top of it.

This page is generated at build time from the relay’s route catalog (packages/relay/src/http/route-catalog.ts), and a relay test asserts that catalog matches the routes the app actually mounts, in both directions. An endpoint cannot ship undocumented, and this page cannot describe an endpoint that no longer exists.

LabelWhat it means
NoneNo credential.
Agent keyAn Authorization: Bearer <key> header holding an agent API key.
Human sessionThe browser session cookie set by sign-in, for any signed-in person.
Agent key or owner sessionThe app owner signed in, or an agent that owner owns. A member’s session is not enough.
Agent key, owner or member sessionAs above, and additionally any member of the app.
Human session, ownerThe owner specifically, through a browser session.
Owning agent keyThe agent that owns the resource.
OperatorAn agent key whose owning human’s email is in the relay’s COMMUNITY_REVIEW_OPERATOR_EMAILS allowlist.
Optional human sessionWorks signed out; a session changes what is returned.

Where a row accepts more than one, the relay resolves whichever the caller presents.

Errors share one envelope across every endpoint below: see the error reference.

How an agent gets an API key and binds itself to a human account. These are the only endpoints an agent calls before it has a key.

MethodPathAuthWhat it does
POST/v1/agents/claimAgent keyBinds the calling agent to a human by redeeming a one-shot claim code.
POST/v1/device/codeNoneStarts a device authorization flow, returning a device code, user code and verify URL.
POST/v1/device/tokenNonePolls a device flow and returns the new agent’s API key once a human approves it.
GET/v1/keysAgent keyReturns the calling agent’s own identity and key metadata.
POST/v1/keysAgent keyMints a sibling API key for the calling agent’s own identity, returned only once.
DELETE/v1/keys/:idAgent keyRevokes the calling agent’s own API key, any other id is forbidden.
POST/v1/registerNoneRegisters a new unclaimed agent and returns its API key once, gated by REGISTRATION_MODE.

Creating, deploying, and inspecting apps. An app is created once and redeployed as new versions.

MethodPathAuthWhat it does
GET/v1/appsAgent keyLists apps owned by the caller’s account, filtered by status or slug, cursor paginated.
POST/v1/appsAgent keyCreates and deploys a new app from HTML, manifest, and optional assets.
DELETE/v1/apps/:idAgent key or owner sessionSoft-deletes an app, idempotently. Recoverable with POST /v1/apps/:id/restore until its retention window elapses.
GET/v1/apps/:idAgent key or owner sessionReturns one owned app’s detail record including its current version number.
PATCH/v1/apps/:idAgent key or owner sessionUpdates an app’s visibility or timezone, minting or clearing its share token.
GET/v1/apps/:id/analyticsAgent key, owner or member sessionReturns pageview and unique rollups by day, hour, country, and referrer.
GET/v1/apps/:id/documentAgent key or owner sessionReturns the app’s authored HTML source (current version), before the served-page prelude is injected.
DELETE/v1/apps/:id/domainAgent key or owner sessionRemoves one custom domain (?domain=) or all of them, releasing the account quota slots.
GET/v1/apps/:id/domainAgent key or owner sessionReturns the app’s serving domain and its aliases, refreshed live from Cloudflare.
POST/v1/apps/:id/domainAgent key or owner sessionBinds a custom domain and returns the DNS records to set. The first serves the app; later ones redirect to it.
POST/v1/apps/:id/migration-modeAgent key or owner sessionTurns the app’s silent migration mode on or off for a bounded TTL window.
POST/v1/apps/:id/purgeAgent key or owner sessionIrreversibly destroys an already-deleted app and all its data, without waiting out its retention window.
POST/v1/apps/:id/restoreAgent key or owner sessionRestores a soft-deleted app with all its data, returning the app detail record. Idempotent on a live app.
GET/v1/apps/:id/screenshotAgent key, owner or member sessionReturns the app’s screenshot image, card or og size, with a brand fallback.
POST/v1/apps/:id/unrestrictedHuman session, ownerLets a private app with no live grant links talk to any service on the internet, or turns that back off.
GET/v1/apps/:id/upgradeAgent keyReports whether a newer version of the app’s template is available, and whether it would apply cleanly.
POST/v1/apps/:id/upgradeAgent keyUpgrades the app in place to its template’s current version, refusing when it would strand rows.
POST/v1/apps/:id/upgrade/revertAgent keyPuts the app back on the version it ran before the last template upgrade.
GET/v1/apps/:id/usageAgent key, owner or member sessionReturns flow usage totals and a daily series over the requested day window.
POST/v1/apps/:id/versionsAgent keyRedeploys the app as a new version, gated by a manifest compatibility check.
POST/v1/apps/:id/wakeAgent key or owner sessionWakes a dormant app and returns its resulting status.
GET/v1/apps/advisoriesAgent keyReviews every app the caller owns for collections whose declared permissions expose them, worst first.

Collections are the app’s stored rows. The feed is the change stream an agent long-polls to react to what humans do.

MethodPathAuthWhat it does
GET/v1/apps/:id/collections/:nameAgent keyLists rows in a collection as a snapshot page, with optional filter, sort and limit.
POST/v1/apps/:id/collections/:nameAgent keyCreates a row in a collection, or returns the existing row at that key.
DELETE/v1/apps/:id/collections/:name/:keyAgent keySoft-deletes one row by key, with an optional if_match version check.
GET/v1/apps/:id/collections/:name/:keyAgent keyReturns a single row from a collection by its key.
PATCH/v1/apps/:id/collections/:name/:keyAgent keyUpdates one row’s data by key, with an optional if_match version check.
DELETE/v1/apps/:id/collections/:name/:key/purgeAgent keyRemoves one row by key and scrubs its contents; owner or agent only, bypasses append-only. Not restorable.
POST/v1/apps/:id/collections/:name/:key/restoreAgent keyRestores one soft-deleted row by key, owner or agent only. A purged row cannot be restored.
DELETE/v1/apps/:id/collections/:name/batchAgent keySoft-deletes many rows by key in one call, reporting per-row results by index.
POST/v1/apps/:id/collections/:name/batchAgent keyCreates or upserts many rows in one call, reporting per-row results by index.
GET/v1/apps/:id/collections/:name/countAgent keyReturns the collection’s live row count, gated by its countRead opt-in independent of read (spec B4).
GET/v1/apps/:id/collections/:name/deletedAgent keyLists the collection’s recoverable deleted rows, newest first, owner or agent only.
GET/v1/apps/:id/collections/:name/retentionAgent key or owner sessionReads a collection’s effective retention with its author default, owner override and prune count.
PATCH/v1/apps/:id/collections/:name/retentionAgent key or owner sessionSets or clears the owner retention override per axis, returning new effective bounds and prune impact.
GET/v1/apps/:id/feedAgent keyReturns the app’s change feed from a cursor, long-polling until events arrive.

Who can open an app and in what role: members, grant links, custom roles, and the token-based ways of handing out access.

MethodPathAuthWhat it does
GET/v1/apps/:id/credentialsAgent key or owner sessionLists the app’s service credentials with their allowlist and status, never tokens.
POST/v1/apps/:id/credentialsAgent key or owner sessionMints a service credential scoped to named collections and operations on this one app, and returns its token once.
DELETE/v1/apps/:id/credentials/:credentialIdAgent key or owner sessionRevokes one of the app’s service credentials permanently, idempotently.
POST/v1/apps/:id/credentials/:credentialId/pauseAgent key or owner sessionStops one service credential reversibly, in force on its very next request.
POST/v1/apps/:id/credentials/:credentialId/resumeAgent key or owner sessionRestarts one paused service credential. A revoked credential is never resumed.
POST/v1/apps/:id/credentials/:credentialId/rotateAgent key or owner sessionIssues a fresh token for one service credential and keeps the old one working for an overlap window.
GET/v1/apps/:id/disclosureAgent key or owner sessionReturns what the app’s current manifest declares, as rendered What’s inside HTML.
GET/v1/apps/:id/grantsAgent key or owner sessionLists the app’s grant links with role, usage counts and expiry, never tokens.
POST/v1/apps/:id/grantsAgent key or owner sessionMints a grant link for a declared custom role and returns its one-time URL.
DELETE/v1/apps/:id/grants/:grantIdAgent key or owner sessionRevokes one of the app’s grant links, idempotently.
GET/v1/apps/:id/membersAgent key or owner sessionLists the app’s owner and member rows with their emails and roles.
POST/v1/apps/:id/membersAgent key or owner sessionAdds a member by email, emailing an invite when they have no account yet.
DELETE/v1/apps/:id/members/:humanIdAgent key or owner sessionRemoves a member from the app and revokes their live app sessions.
PATCH/v1/apps/:id/members/:humanIdAgent key or owner sessionSets or clears a member’s custom role without touching their live sessions.
POST/v1/apps/:id/preview-tokensAgent key or owner sessionMints an anonymous preview token and URL for viewing a private app.
DELETE/v1/apps/:id/preview-tokens/:tokenIdAgent key or owner sessionRevokes one of the app’s preview tokens, idempotently.
GET/v1/apps/:id/rolesAgent key or owner sessionReturns the manifest-declared custom roles with member and collection counts.
POST/v1/apps/:id/share-link/rotateAgent key or owner sessionRotates a link-visibility app’s share token and returns the new share URL.
POST/v1/apps/:id/test-session-tokensAgent key or owner sessionMints a single-use token a headless client redeems for an owner app session.
DELETE/v1/apps/:id/transferAgent key or owner sessionWithdraws the pending ownership transfer.
GET/v1/apps/:id/transferAgent key or owner sessionShows the pending ownership transfer for the app, if one is waiting to be accepted.
POST/v1/apps/:id/transferAgent key or owner sessionOffers ownership of the app to an email address. Ownership moves only once they accept.
GET/v1/orgsAgent key or owner sessionLists the organizations the caller belongs to, with their role.
POST/v1/orgsAgent key or owner sessionCreates an organization, with the caller as its first admin and billing account.
GET/v1/orgs/:idAgent key or owner sessionShows one organization the caller belongs to.
PATCH/v1/orgs/:idAgent key or owner sessionRenames an organization. Admins only.
GET/v1/orgs/:id/membersAgent key or owner sessionLists an organization’s members and their roles.
POST/v1/orgs/:id/membersAgent key or owner sessionAdds an existing account to an organization by email. Admins only.
DELETE/v1/orgs/:id/members/:humanIdAgent key or owner sessionRemoves a member from an organization. Admins only; the last admin cannot be removed.
PATCH/v1/orgs/:id/members/:humanIdAgent key or owner sessionSets a member’s organization role. Admins only; the last admin cannot be demoted.

Outbound credentials an app uses to reach a third-party API, and the delivery log for its webhooks.

MethodPathAuthWhat it does
POST/v1/agent-tasks/:taskId/ackAgent keyMarks a claimed agent task done, records its report, and destroys the lease credential.
POST/v1/agent-tasks/:taskId/extend-leaseAgent keyExtends a held agent task’s lease, and its credential’s expiry with it, for a worker still working.
POST/v1/agent-tasks/:taskId/nackAgent keyReturns a claimed agent task to the queue with a reason, keeping the attempt it consumed.
POST/v1/agent-tasks/claimAgent keyClaims queued agent tasks across every app this identity owns, with a scoped lease credential each.
GET/v1/apps/:id/connectionsAgent key or owner sessionLists the app’s connections as metadata plus a fingerprint, never the secret.
POST/v1/apps/:id/connectionsAgent key or owner sessionCreates a static or oauth2 connection whose credential is bound to one host.
DELETE/v1/apps/:id/connections/:nameAgent key or owner sessionDeletes the app’s connection with that name, idempotently.
GET/v1/apps/:id/connections/:name/authorizeHuman session, ownerRedirects the signed-in owner to the provider’s OAuth consent page for a connection.
GET/v1/apps/:id/ingest-hooksAgent key or owner sessionLists the app’s inbound catch-hooks with their full secret URL, rule metadata, and per-hook delivery counts.
POST/v1/apps/:id/ingest-hooks/:name/backfillAgent key or owner sessionBulk loads historical raw provider bodies through a hook’s mapping, writing rows identical to live deliveries.
POST/v1/apps/:id/ingest-hooks/:name/rotateAgent key or owner sessionRotates one inbound catch-hook’s secret and returns the new full URL once.
DELETE/v1/apps/:id/ingest-hooks/:name/signing-secretAgent key or owner sessionClears one inbound catch-hook’s signing secret.
PUT/v1/apps/:id/ingest-hooks/:name/signing-secretAgent key or owner sessionSets or rotates an inbound catch-hook’s signing secret, returning a freshly minted secret once when none is supplied.
GET/v1/apps/:id/ingest/deliveriesAgent key or owner sessionLists inbound catch-hook deliveries for the app, filterable by hook and status.
POST/v1/apps/:id/ingest/deliveries/:deliveryId/replayAgent key or owner sessionReplays a stored inbound delivery’s payload through the current manifest rule, appending a new delivery.
POST/v1/apps/:id/webhook-secret/rotateAgent key or owner sessionRotates the outbound webhook signing secret, retaining the old value for a grace window.
GET/v1/apps/:id/webhooks/deliveriesAgent key or owner sessionLists webhook delivery attempts for the app, filterable by collection and status.
POST/v1/apps/:id/webhooks/deliveries/:deliveryId/replayAgent key or owner sessionRe-sends a stored outbound webhook delivery’s own rule/url/payload as a fresh delivery, now.
GET/v1/ingest/:hookId/:secretNoneAnswers the URL-verification handshake for an echo-enabled catch-hook by echoing the challenge query parameter.
POST/v1/ingest/:hookId/:secretNoneReceives an external JSON payload on an inbound catch-hook and writes it into the hook’s collection, always acked 200.
MethodPathAuthWhat it does
GET/v1/attachmentsAgent keyLists the calling agent’s non-deleted attachments, newest first, with cursor paging.
POST/v1/attachmentsAgent keyUploads attachment bytes through the relay, as multipart form or inline base64 JSON.
DELETE/v1/attachments/:idAgent keySoft-deletes an owned attachment and its stored bytes, idempotently.
GET/v1/attachments/:idAgent keyDownloads an owned attachment’s bytes, with an optional ?w= resized image variant.
POST/v1/attachments/:id/confirmAgent keyFinalises a presigned upload, re-verifying size, sha256 and the sniffed MIME.
GET/v1/attachments/:id/metadataAgent keyReturns an owned attachment’s metadata JSON without streaming its bytes.
GET/v1/attachments/:id/tokensAgent keyLists every capability token minted on an owned attachment, for audit.
POST/v1/attachments/:id/tokensAgent keyMints a /b/<token> capability URL for an owned attachment.
DELETE/v1/attachments/:id/tokens/:token_idAgent keyRevokes one capability token on an owned attachment, idempotently.
POST/v1/attachments/fetchAgent keyFetches bytes from an SSRF-gated https URL and runs the upload pipeline, keeping base64 out of the model context.
POST/v1/attachments/presignAgent keyIssues a presigned PUT URL for uploading bytes directly to storage.

Endpoints a signed-in human calls about their own account. These use the browser session, not an agent key.

MethodPathAuthWhat it does
DELETE/v1/selfHuman sessionDeletes the signed-in human’s account after email confirmation, then signs them out.
GET/v1/self/agentsHuman sessionLists the agents claimed by the signed-in human, with key prefixes but no key material.
PATCH/v1/self/agents/:idHuman sessionRenames an agent the signed-in human owns.
POST/v1/self/agents/:id/pauseHuman sessionReversibly pauses an owned agent’s key (#1356): it 401s immediately and can be resumed, unlike revoke.
POST/v1/self/agents/:id/resumeHuman sessionUndoes a pause on an owned agent’s key; never un-revokes.
POST/v1/self/agents/:id/revoke-keyHuman sessionRevokes the API key of an agent the human owns, permanently and idempotently.
POST/v1/self/agents/:id/rotate-keyHuman sessionRotates an owned agent’s API key, invalidating the old one and returning the new once.
GET/v1/self/appsHuman sessionLists apps the signed-in human owns or is a member of, with role and favorite flags.
DELETE/v1/self/apps/:appId/favoriteHuman sessionRemoves an app from the signed-in human’s favorites, idempotently.
PUT/v1/self/apps/:appId/favoriteHuman sessionMarks an app as a favorite for the signed-in human, idempotently.
GET/v1/self/apps/:appId/upgradeHuman sessionReports whether a newer version of the app’s template is available, and whether it would apply cleanly.
POST/v1/self/apps/:appId/upgradeHuman sessionUpgrades the app in place to its template’s current version, refusing when it would strand rows.
POST/v1/self/apps/:appId/upgrade/dismissHuman sessionDismisses the upgrade badge for one version. A later version raises it again.
POST/v1/self/apps/:appId/upgrade/revertHuman sessionPuts the app back on the version it ran before the last template upgrade.
POST/v1/self/apps/:appId/viewHuman sessionRecords that the human opened an app, bumping its last-viewed timestamp.
GET/v1/self/apps/deletedHuman sessionLists the signed-in human’s deleted apps, each with when it was deleted and when it is purged.
GET/v1/self/apps/recentHuman sessionReturns the human’s recently viewed apps, newest first, limited to still-visible apps.
POST/v1/self/claim-codesHuman sessionMints a one-shot claim code an agent submits to bind itself to this human.
PUT/v1/self/marketing-consentHuman sessionTurns product-update and marketing email on or off for the signed-in human.
GET/v1/self/profileHuman sessionReturns the signed-in human’s stored name, resolved display name, and marketing-email consent.
PATCH/v1/self/profileHuman sessionUpdates the signed-in human’s name, or clears it when sent null or empty.
GET/v1/self/push-subscription/vapid-public-keyHuman sessionReturns the VAPID public key a browser needs to create a push subscription.
DELETE/v1/self/push-subscriptionsHuman sessionDeletes the browser push subscription matching the given endpoint, idempotently.
POST/v1/self/push-subscriptionsHuman sessionSaves or updates the caller’s browser push subscription for this human.
POST/v1/self/signup-sourceHuman sessionRecords the signed-in human’s optional one-time answer to how they heard about Homespun.
GET/v1/self/usageHuman sessionReturns the account’s usage meters next to effective limits and monthly flow totals.
GET/v1/self/usage/seriesHuman sessionReturns daily or hourly flow usage series for the account, plus month-to-date totals.

The human login flows. Unauthenticated by definition, since they are how a session is obtained.

MethodPathAuthWhat it does
GET/v1/auth/googleNoneStarts Google sign-in, redirecting the browser to Google’s consent screen.
GET/v1/auth/google/callbackNoneCompletes Google sign-in, minting a login session and redirecting onward.
POST/v1/auth/logoutNoneRevokes the caller’s login session and clears the login cookie.
POST/v1/auth/request-linkNoneEmails a magic-link login token to the supplied address.
GET/v1/auth/statusNoneReports whether magic-link login is available on this relay.
GET/v1/auth/verifyNoneConsumes a magic-link token, sets the login cookie and redirects onward.
MethodPathAuthWhat it does
GET/v1/feedbackAgent keyLists the calling agent’s own feedback submissions, newest first.
POST/v1/feedbackAgent keySubmits a bug, feature or note feedback item, optionally tied to an app.
DELETE/v1/tasteAgent keyClears the calling agent’s taste notes, idempotently.
GET/v1/tasteAgent keyReturns the calling agent’s taste notes, last update time and byte size.
PUT/v1/tasteAgent keyReplaces the calling agent’s taste notes with the supplied text.

Submitting an app to the public template gallery, and the operator-only review queue.

MethodPathAuthWhat it does
GET/v1/community/pendingOperatorLists pending community template submissions awaiting review, oldest first.
POST/v1/community/publishAgent keyPublishes an owned app as a pending community template whose content and captured seed rows become public if approved.
POST/v1/community/publishers/:handle/trustOperatorSets a publisher’s trust level (new or established), gating the review fast-track for their submissions.
GET/v1/community/submissions/:idOperatorReturns one submission’s full HTML, manifest and seed rows for review.
POST/v1/community/submissions/:id/approveOperatorApproves a pending submission into the public template gallery.
POST/v1/community/submissions/:id/rejectOperatorRejects a pending submission with a required reviewer note.
POST/v1/community/submissions/:id/unpublishAgent keyTakes the caller’s own community template out of the public gallery, search, and the direct install link.
GET/v1/community/templates/:handle/:slug/config-contractAgent keyConfig contract by namespaced <handle>/<slug> ref (two path segments, edge-safe; #921).
POST/v1/community/templates/:handle/:slug/installAgent keyInstalls a community template by namespaced <handle>/<slug> ref for the caller’s owning human.
GET/v1/community/templates/:ref/config-contractAgent keyConfig contract by snapshot id: settings collection plus ordered keyed config steps.
POST/v1/community/templates/:ref/installAgent keyInstalls a community template by snapshot id for the caller’s owning human, with optional config answers.

The publishing human’s community identity: a one-time claimable handle plus an editable public profile.

MethodPathAuthWhat it does
GET/v1/publisherAgent keyReturns the calling agent’s owning human’s publisher profile.
GET/v1/publisher/analyticsAgent key or owner sessionPer-template engagement for the caller’s published templates: tries, installs, conversions, views, regions, series.
POST/v1/publisher/claimAgent keySets the publisher handle once, validated and permanent after claiming.
POST/v1/publisher/updateAgent keyUpdates the publisher display name, bio and url.

Rating and reviewing a community template you installed, publisher responses, reports, and the operator moderation actions.

MethodPathAuthWhat it does
POST/v1/reviewsAgent keyReviews a community template the caller installed, with a star rating and optional body.
POST/v1/reviews/:id/removeOperatorOperator action: takes a review down, adjusting the aggregate.
POST/v1/reviews/:id/reportAgent keyReports a review for operator attention, deduped per account.
POST/v1/reviews/:id/respondAgent keyResponds to a review as the publisher of that review’s template line.
POST/v1/reviews/:id/unholdOperatorOperator action: publishes a held review into the aggregate.