Skip to main content
Thesis owner endpoints live under /api/thesis/* and require authentication (Authorization: Bearer sf_live_... or browser session), except the public ticker lookup noted below. The CLI, TypeScript SDK, and Agent SDK call the same routes — see Thesis lifecycle for the conceptual model and Heartbeat for the per-thesis monitor loop. A private thesis is owned by exactly one user. Owner read and write paths 404 when the caller does not own the resource. Public thesis reads return only published thesis data.

CRUD

POST /api/thesis/create

Two modes:
  • POST /api/thesis/create — returns 202 immediately and forms the causal tree in the background.
  • POST /api/thesis/create?sync=true — runs formation inline (up to 5 minutes) and returns the formed thesis on 200.
Body A claim classifier rejects rationale, action verbs, single tickers, or unverifiable statements with code: THESIS_NOT_A_CLAIM. Statements shorter than 20 chars return THESIS_TOO_SHORT. Response (202 / 200)
With ?sync=true, tree is populated and status is active on success. Errors

GET /api/thesis/

Returns the full state, including tree, positions, and strategies merged into one document.

PATCH /api/thesis/

Body (all optional) Returns the updated thesis. 404 when the thesis is not yours.

DELETE /api/thesis/

Hard-deletes the thesis and all related rows (signals, evaluations, positions, strategies, notifications). Returns { ok: true } on success.

Signals

Inject evidence into a thesis. The monitor loop also writes signals automatically; this endpoint is for analyst notes, off-platform news, or programmatic forwards. Body Response 200
Errors: 400 type and content are required, 404 Thesis not found.

Evaluation

Triggers a deep evaluation cycle on demand. Heartbeat runs evaluations on its own cadence — only call this for an immediate refresh. Errors Response 200: full evaluation result — confidence, node probabilities, signals consumed, killConditions checked, model used, cost.

Augment

Runs LLM-driven causal-tree augmentation. The model proposes new nodes, edges, and probabilities based on the current state and recent signals. Body: none required. Optionally pass { depth?: number, focusNodeId?: string } to scope the augmentation. Response 200
Errors

Causal-tree node mutation

Direct, zero-LLM-cost edits to the tree. Use this when an analyst overrides a probability or locks a node from automatic updates. Body Errors

Fork / evolve

Two modes, both POST:
  • Pure fork: empty body or {} — clones the thesis as-is for a new owner-perspective.
  • Evolve: send { newRawThesis, newTitle?, reason?, inheritEdgeMarketIds? } — creates a new thesis as a frame-shift of the old one. Owner-only.
Errors

Context / read

Heartbeat

See Heartbeat for the full schema, validation ranges, defaults, and CLI mapping.

Positions

Positions linked to a thesis. The runtime, autopilot, and CLI write to this surface; user-side code can also attach external positions for backtests or analyst notes.

POST body — required

POST body — optional

Returns { id: <posId> } with status 201. PATCH accepts any subset of those fields. DELETE records an exit timestamp; positions are not hard-deleted.

Strategies

A strategy is a structured plan for trading the thesis — direction, horizon, entry / stop / take-profit, sizing, soft conditions. Both POST and PATCH accept the same body shape; POST requires the core fields, PATCH only the fields you want to change.

Body fields

Publishing

POST body

Response 200
Errors

DELETE

Returns { "unpublished": true }. The public page returns 404 immediately; the underlying thesis is unaffected. Public theses are reachable at /thesis/{slug} for browsers and GET /api/public/thesis/{slug} for agents.

Public thesis reads

These public endpoints do not require browser session ownership. SDK and Agent SDK callers still use an API-keyed client by default because the strict SDK/Agent contract is API-key-first for hosted reads.

What-if

Runs a counter-factual evaluation. The response shows projected confidence and edge metrics under the override scenario without writing an evaluation row.

Body

Errors

Video

SDK and Agent SDK mapping

The TypeScript SDK exposes this thesis surface under sf.theses.*: Agent SDK canonical tools mirror the same names with dotted tool ids, for example theses.context, theses.heartbeat.update, theses.positions.create, theses.strategies.list, theses.evaluate, and theses.public.get. Read tools have sideEffect: none; thesis mutation, evaluation, augmentation, fork, publish, and unpublish tools are sideEffect: user_write and require explicit Agent policy allowance.

CLI shorthand

See also

Thesis lifecycle

Conceptual model and CLI walkthrough.

Heartbeat

Per-thesis monitor loop schema.

Direct API access

Auth, base URLs, and first calls.

Errors

Full error envelope reference.