The personal-website API: the blog's public feed and slug resolution, the editor's post and revision lifecycle — on the public blog realm and the operator's private journal alike — the tag index each realm filters by, the vendor consent flows this server custodies, and the scheduler's run history.
session Set by POST /auth/session against a mailed code. httpOnly, so nothing but the browser ever holds it.
The blog's public read surface.
| Name | In | Type | Description |
|---|---|---|---|
include | query | {"type":"string","enum":["html"]} | Pass html to include each post's rendered body. |
limit | query | {"type":"integer","minimum":1} | Return at most this many posts. |
| Status | Description |
|---|---|
200 | { posts: PublishedPostView[] } |
400 | limit is not a positive integer. |
The whole public lookup in one round trip: the rendered post when the slug is current, the canonical slug to redirect to when it was retired, or gone when the post was archived.
| Name | In | Type | Description |
|---|---|---|---|
slug required | path | {"type":"string"} | Public slug (lowercase letters, digits, hyphens). |
| Status | Description |
|---|---|
200 | SlugResolution |
404 | No post answers to this slug. |
Every read the blog's build needs in one round trip: the index and tag lists, the feed entries, the full detail views, the retired slugs that redirect, and the archived slugs that are gone. Public for the same reason the pages it builds are — this is the site itself, a request ahead of publication.
| Name | In | Type | Description |
|---|---|---|---|
feedLimit | query | {"type":"integer","minimum":1} | Cap feedViews at this many entries. How long a feed runs is the consumer's policy; uncapped when omitted. |
| Status | Description |
|---|---|
200 | SiteSnapshot |
400 | feedLimit is not a positive integer. |
Passwordless sign-in: a one-time code by email, traded for a session cookie. Non-2xx responses are AuthApiError ({ error, code? }).
Sends a 6-digit code that expires in 10 minutes and signs in once. Answers 202 whether or not the address has an account: which addresses exist, and how recently one asked, are not facts this endpoint hands out.
application/json required
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"format": "email"
}
}
}| Status | Description |
|---|---|
202 | { sent: true } — see above; this is not a delivery receipt. |
400 | code: "invalid-email" — the field was not an address at all. |
How the admin app decides between its screens and its sign-in form.
| Status | Description |
|---|---|
200 | SessionResponse |
401 | code: "unauthorized" — no cookie, or it no longer resolves. |
Trades a mailed code for a session cookie: httpOnly, SameSite=Lax, absolute expiry, revocable server-side. The code is spent either way — a wrong guess costs an attempt against every code the address is holding.
application/json required
{
"type": "object",
"required": [
"email",
"code"
],
"properties": {
"email": {
"type": "string",
"format": "email"
},
"code": {
"type": "string",
"description": "6 digits."
}
}
}| Status | Description |
|---|---|
200 | SessionResponse, plus the session cookie. |
400 | Body is not JSON, or email/code are missing. |
401 | code: "invalid-code" — wrong, expired, spent, or out of attempts. Which one is deliberately not said. |
Deletes the session row and clears the cookie. Idempotent — signing out without a session is a 204 too.
| Status | Description |
|---|---|
204 | Signed out; no body. |
The blog editor's post lifecycle — every route an admin session. Non-2xx responses are BlogApiError ({ error, code?, version? }); code marks the failures a client can branch on.
Every tag attached to at least one of this realm's posts, most-used first — drafts included, since tags mirror the current draft. Tags used only in the other realm do not appear.
| Name | In | Type | Description |
|---|---|---|---|
q | query | {"type":"string"} | Narrow to tags whose name starts with this prefix. |
| Status | Description |
|---|---|
200 | { tags: TagView[] } |
Drafts, published, and archived alike — the admin index.
| Name | In | Type | Description |
|---|---|---|---|
tag | query | {"type":"string"} | Only posts whose draft carries this tag. |
| Status | Description |
|---|---|
200 | { posts: AdminPostView[] } |
Starts as an untitled scaffold draft.
| Status | Description |
|---|---|
201 | { post: EditorPostView } |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
204 | Deleted; no body. |
404 | No such post. |
Optimistic concurrency: baseVersion is the version the edit was based on; a mismatch means the post changed elsewhere and comes back as a 409 carrying the version the server holds.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
application/json required
{
"type": "object",
"required": [
"content",
"baseVersion"
],
"properties": {
"content": {
"type": "string",
"description": "Full draft source."
},
"baseVersion": {
"type": "integer"
}
}
}| Status | Description |
|---|---|
200 | SaveDraftResponse |
400 | Body is not JSON, or content/baseVersion are missing. |
404 | No such post. |
409 | code: "conflict" — version is what the server holds. |
The draft rendered exactly as it would publish.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { preview: DraftPreview } |
404 | No such post. |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
application/json required
{
"type": "object",
"required": [
"slug"
],
"properties": {
"slug": {
"type": "string",
"description": "Lowercase letters, digits, single hyphens (max 80 chars)."
}
}
}| Status | Description |
|---|---|
200 | { post: EditorPostView } |
400 | code: "invalid-slug" | "reserved-slug". |
404 | No such post. |
409 | code: "slug-taken" — another post uses or redirects from it. |
Requires a title: "title:" frontmatter or a leading "# heading" in the draft.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
400 | code: "title-required". |
404 | No such post. |
Back to a draft; its public page disappears.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
Deliberate removal: the public slug starts answering gone.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
Autosave and publish snapshots of a blog post's content. Admin session, as above.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { revisions: RevisionSummaryView[] } |
404 | No such post. |
The summary plus the revision's full content.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
revisionId required | path | {"type":"string"} | Revision id, as listed by GET /blog/posts/{id}/revisions. |
| Status | Description |
|---|---|
200 | { revision: RevisionView } |
404 | No such post or revision. |
Makes the revision's content the current draft.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
revisionId required | path | {"type":"string"} | Revision id, as listed by GET /blog/posts/{id}/revisions. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post or revision. |
The journal's entries — the same lifecycle as Posts on the operator's private realm, where publishing reads as logging. No public surface exists: every route, reads included, requires the admin session. The one way out is promotion: an entry copied onto the blog as a draft, which by itself publishes nothing.
Every tag attached to at least one of this realm's posts, most-used first — drafts included, since tags mirror the current draft. Tags used only in the other realm do not appear.
| Name | In | Type | Description |
|---|---|---|---|
q | query | {"type":"string"} | Narrow to tags whose name starts with this prefix. |
| Status | Description |
|---|---|
200 | { tags: TagView[] } |
Drafts, published, and archived alike — the admin index.
| Name | In | Type | Description |
|---|---|---|---|
tag | query | {"type":"string"} | Only posts whose draft carries this tag. |
| Status | Description |
|---|---|
200 | { posts: AdminPostView[] } |
Starts as an untitled scaffold draft.
| Status | Description |
|---|---|
201 | { post: EditorPostView } |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
204 | Deleted; no body. |
404 | No such post. |
Optimistic concurrency: baseVersion is the version the edit was based on; a mismatch means the post changed elsewhere and comes back as a 409 carrying the version the server holds.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
application/json required
{
"type": "object",
"required": [
"content",
"baseVersion"
],
"properties": {
"content": {
"type": "string",
"description": "Full draft source."
},
"baseVersion": {
"type": "integer"
}
}
}| Status | Description |
|---|---|
200 | SaveDraftResponse |
400 | Body is not JSON, or content/baseVersion are missing. |
404 | No such post. |
409 | code: "conflict" — version is what the server holds. |
The draft rendered exactly as it would publish.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { preview: DraftPreview } |
404 | No such post. |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
application/json required
{
"type": "object",
"required": [
"slug"
],
"properties": {
"slug": {
"type": "string",
"description": "Lowercase letters, digits, single hyphens (max 80 chars)."
}
}
}| Status | Description |
|---|---|
200 | { post: EditorPostView } |
400 | code: "invalid-slug" | "reserved-slug". |
404 | No such post. |
409 | code: "slug-taken" — another post uses or redirects from it. |
Requires a title: "title:" frontmatter or a leading "# heading" in the draft.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
400 | code: "title-required". |
404 | No such post. |
Back to a draft; its public page disappears.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
Deliberate removal: the public slug starts answering gone.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post. |
Copies this post's working draft into the blog realm as a new draft — body, title, and tags exactly as its frontmatter yields them. A copy and not a move: this post is untouched, the copy is its own post from here on, and nothing is published on either side. Promoting a second time makes a second copy, which is why the copies a post already has ride along on EditorPostView.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
201 | { copy: PromotedCopyView } — the draft just created. |
404 | No such post. |
Autosave and log snapshots of a journal entry's content. Admin session, as above.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
| Status | Description |
|---|---|
200 | { revisions: RevisionSummaryView[] } |
404 | No such post. |
The summary plus the revision's full content.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
revisionId required | path | {"type":"string"} | Revision id, as listed by GET /journal/posts/{id}/revisions. |
| Status | Description |
|---|---|
200 | { revision: RevisionView } |
404 | No such post or revision. |
Makes the revision's content the current draft.
| Name | In | Type | Description |
|---|---|---|---|
id required | path | {"type":"string"} | Post id. |
revisionId required | path | {"type":"string"} | Revision id, as listed by GET /journal/posts/{id}/revisions. |
| Status | Description |
|---|---|
200 | { post: EditorPostView } |
404 | No such post or revision. |
The youfoundron_oura application's public half: the operator's consent flow (connect → Oura → redirect), the chain's status, the registration's legal texts, and the webhook receiver that keeps the local sleep store current. This server is the token custodian — tokens live in its database and never in a response, and no endpoint returns or force-refreshes them. The worker-facing sleep feed answers from the local store on the private-network listener, outside this spec.
Mints a single-use state and bounces the operator's browser to Oura's consent screen. The bootstrap, and the recovery path whenever the refresh chain breaks (status: reconnect_required).
| Status | Description |
|---|---|
302 | Redirect to Oura's authorize URL. |
Where the Oura consent screen sends the browser back. Validates the single-use state, exchanges the code server-side, and stores the tokens — then hands the browser to the admin app's connect screen with a bare outcome name and expiry in the URL fragment, never token material of any kind.
| Name | In | Type | Description |
|---|---|---|---|
code | query | {"type":"string"} | Authorization code — consumed here, shown nowhere. |
state | query | {"type":"string"} | Must match a stored, unexpired, unused state. |
error | query | {"type":"string"} | OAuth2 error code, when consent was denied or failed. |
error_description | query | {"type":"string"} | Human-readable detail accompanying error. |
| Status | Description |
|---|---|
302 | Redirect to the admin's connect outcome screen, every outcome. |
Answers Oura's one-time subscription check: when the verification_token matches the configured one, the challenge is echoed back. Absent configuration, the path answers 404 — the receiver does not exist. Dialed by Oura, never by a browser.
| Status | Description |
|---|---|
200 | { challenge }, echoed. |
Where Oura posts event notifications, HMAC-signed with the application's client secret over timestamp + body. The delivery is acknowledged immediately and treated as a hint: ingestion re-fetches the named document with this server's own token and upserts (or, on a confirmed 404, deletes) the stored copy — then asks for a readme republish when something actually changed. Absent configuration, the path answers 404.
| Status | Description |
|---|---|
200 | Acknowledged; ingestion proceeds asynchronously. |
Connection status, access-token expiry, last update, the store's size and newest day, and the worker routes' last audit entries. No token material — there is no endpoint that returns or force-refreshes tokens, by design.
| Status | Description |
|---|---|
200 | { status, accessExpiresAt, updatedAt, lastAuditAt, lastAuditOutcome, storeDocuments, storeLatestDay, lastSyncAt, lastSyncOutcome, lastWebhookAt, lastWebhookOutcome } |
The registration's privacy policy, as plain text.
| Status | Description |
|---|---|
200 | Plain text. |
The registration's terms of service, as plain text.
| Status | Description |
|---|---|
200 | Plain text. |
The Strava application's public half, on the same custody terms as Oura above: the operator's consent flow (connect → Strava → redirect), the chain's status, and the webhook receiver that keeps the local activity store current — tokens in the database and never in a response. Consent asks for activity:read_all and a grant that comes back without it is refused outright. The worker-facing activities feed answers from the local store on the private-network listener, outside this spec.
Mints a single-use state and bounces the operator's browser to Strava's consent screen, asking for activity:read_all. The bootstrap, and the recovery path whenever the refresh chain breaks (status: reconnect_required) or the grant came back short of the scope.
| Status | Description |
|---|---|
302 | Redirect to Strava's authorize URL. |
Where the Strava consent screen sends the browser back. Validates the single-use state, checks the granted scope, exchanges the code server-side, and stores the tokens — then hands the browser to the admin app's connect screen with a bare outcome name and expiry in the URL fragment, never token material of any kind. A grant without activity:read_all is refused and nothing is stored.
| Name | In | Type | Description |
|---|---|---|---|
code | query | {"type":"string"} | Authorization code — consumed here, shown nowhere. |
state | query | {"type":"string"} | Must match a stored, unexpired, unused state. |
scope | query | {"type":"string"} | Comma-separated scopes the athlete actually granted. Must include activity:read_all or the run is refused. |
error | query | {"type":"string"} | OAuth2 error code, when consent was denied or failed. |
| Status | Description |
|---|---|
302 | Redirect to the admin's connect outcome screen, every outcome. |
Answers Strava's one-time subscription check: when hub.mode is subscribe and hub.verify_token matches the configured one, hub.challenge is echoed back within Strava's two-second deadline. Absent configuration, the path answers 404 — the receiver does not exist. Dialed by Strava, never by a browser.
| Status | Description |
|---|---|
200 | { "hub.challenge" }, echoed. |
Where Strava posts event notifications. The delivery is acknowledged immediately (Strava's two-second deadline) and treated as a hint: it must name the registered subscription, and ingestion re-fetches the named activity with this server's own token and upserts (or, on a confirmed 404, deletes) the stored copy — then asks for a readme republish when something actually changed. An athlete event with authorized: "false" marks the chain reconnect_required. Absent configuration, the path answers 404.
| Status | Description |
|---|---|
200 | Acknowledged; ingestion proceeds asynchronously. |
Connection status, the granted scope, access-token expiry, last update, the store's size and newest start instant, and the worker routes' last audit entries. No token material — there is no endpoint that returns or force-refreshes tokens, by design.
| Status | Description |
|---|---|
200 | { status, scope, accessExpiresAt, updatedAt, lastAuditAt, lastAuditOutcome, storeActivities, storeLatestStartDate, lastSyncAt, lastSyncOutcome, lastWebhookAt, lastWebhookOutcome } |
The scheduler's calendar and run history — the admin's cron section reads through here. The api stores none of it: the cron app's own sqlite is the record, proxied read-only over the private network.
Schedules and their recorded runs — status, exit code, timestamps, and each run's own stdout/stderr — read live from the scheduler's store. The api holds none of it; a missing or unreachable scheduler is a 503, which local environments always are.
| Status | Description |
|---|---|
200 | { schedules: CronSchedule[], jobs: CronJob[] } |
503 | { error: "scheduler_unreachable" } — no scheduler to read. |
Service plumbing.
| Status | Description |
|---|---|
200 | { status: "ok" } |