Skip to content
undertext developers
Skip to Content
undertext developers

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.

Your server calls Undertext's REST API with a secret key; your page hosts the Undertext editor, which talks to Undertext directly; Undertext sends webhooks to your server; agents connect to Undertext's MCP server.Your productUndertextYour serverAccounts, permissions, the secret keyYour pageUndertext editorAn iframe on Undertext's own domainYour users' agentsClaude Code, Codex, any MCP clientREST APIapi.undertext.shEditor and recordEvery change as it happens,who made it, check-insMCP servermcp.undertext.sh/acmeSeal pagesseal.undertext.sh, open to anyone12345

The five connections

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

UndertextYour product
Accounts and sign-inNo accounts; an Undertext id for each of your usersYours
Names and picturesShown in the editor and on sealsYou send them, and vouch for them
Who may open a documentStored and enforcedYou decide, and set it through the API
Document text and its historyStoredRead it through the API or exports
Where each word came fromRecorded and classifiedRead it through the API
Check-ins and security keysStored, on Undertext's domainYou open the settings window
Seals and seal pagesMade, and drawn in a frame of Undertext'sYou trigger them, hear about them, and show them at your own address
Agent connections and tokensIssued and enforcedYou approve, list and revoke them
Document lists, folders, pinsA user's documents, by idYour screens, your folders
Notifications and emailWebhooksYours to send

From sign-in to seal

  1. Ada signs in to Acme Notes, your product, as usual.

  2. 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.

  3. 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)".

  4. 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.

  5. 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.

  6. 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.

On this page