How Undertext works
What runs where when you build on Undertext, the five connections between your product and Undertext, and who owns what.
Undertext records how a document was written: who typed which words, what agents wrote, what was pasted, and when someone was active in the editor. To do that it needs to be the one watching the writing. So the editor is Undertext's own, served from Undertext's domain and embedded in your page. Everything around it stays yours: accounts, sign-in, document lists, sharing screens and notifications.
The five connections
- Your server calls the REST API with your secret key. It tells Undertext who your users are, creates documents, sets who may open them, starts editor sessions, approves agents and seals documents. See the REST API reference.
- Your page mounts the editor with the embed script. You pass a short-lived session token and a few options, and you hear events back: the title changed, someone followed a link to another document, a seal was made. See the Embed API.
- The editor talks to Undertext directly. Every change goes from Undertext's code, on Undertext's domain, to Undertext's servers. Your page can't see inside the iframe or type into it, and that is what lets a seal say where words came from. See the trust model.
- Undertext sends webhooks to your server when something happens that your users should hear about: a comment, a reply, a mention, a new seal, an agent connected. You turn them into your own notifications. See Webhook events.
- Your users' agents connect to Undertext's MCP server at your platform's own address. When someone connects one, Undertext sends them to your consent page to approve it, then issues the agent's tokens itself. See Connect agents.
Who owns what
| Undertext | Your product | |
|---|---|---|
| Accounts and sign-in | No accounts; an Undertext id for each of your users | Yours |
| Names and pictures | Shown in the editor and on seals | You send them, and vouch for them |
| Who may open a document | Stored and enforced | You decide, and set it through the API |
| Document text and its history | Stored | Read it through the API or exports |
| Where each word came from | Recorded and classified | Read it through the API |
| Check-ins and security keys | Stored, on Undertext's domain | You open the settings window |
| Seals and seal pages | Made, and drawn in a frame of Undertext's | You trigger them, hear about them, and show them at your own address |
| Agent connections and tokens | Issued and enforced | You approve, list and revoke them |
| Document lists, folders, pins | A user's documents, by id | Your screens, your folders |
| Notifications and email | Webhooks | Yours to send |
From sign-in to seal
-
Ada signs in to Acme Notes, your product, as usual.
-
Ada opens a document. Your server checks that Ada may, asks Undertext for an editor session for Ada and that document, and sends the token to the page.
-
The page mounts the editor with the token, and Ada writes. Grace, who Ada shared the document with, suggests changes in a session of Grace's own. Ada's Claude Code, connected to Acme Notes last week, drafts a section through MCP, credited to "Claude Code (Ada Lovelace's agent)".
-
If Ada turned on Verified Presence in the document, the editor asks now and then, as Ada writes there, for a tap of Ada's security key. Each tap is recorded with the writing around it.
-
Ada seals the document, from the editor's Seal button or from a button in your product that calls the API. Undertext takes a snapshot of the text and its record and gives it a short address: on your site, like
acme.com/seals/66G4LF343, where your page shows the seal in a frame of Undertext's, once you've set a seal URL; until then,seal.undertext.sh/66G4LF343. -
Your server hears
seal.created. Ada pastes the essay and its seal line wherever it is going. Anyone who opens the link sees the seal, where the words came from, and that Acme Notes vouches for who Ada is.
What Undertext doesn't do
- Sign anyone in. Undertext never sees a password or an email address unless you send one as a user's detail line.
- Send email. Every notification goes to you as a webhook.
- Show lists of documents. Your product decides how documents are found, filed and ordered. Undertext can list a user's documents for you, but the screens are yours.
- Decide who may open what. Your sharing screens make that choice. Undertext stores the result and enforces it, for people and agents alike.
Undertext's own app, at undertext.net, is built on this same API. Its accounts, sidebar, folders and email are its own, and its editor is the one you embed.