Platforms and keys
A platform is your product as Undertext knows it, set up in the console and reached with secret keys.
A platform is your product as Undertext knows it. Everything you create through the API belongs to one platform: its users, documents, agents, seals and webhook endpoints. Platforms never see each other's data. A user usr_5Kq2Lm8R on Acme Notes and a user usr_5Kq2Lm8R on another platform are two unrelated people.
Undertext's own app, at undertext.net, is a platform too. It uses the same API and the same keys you do.
Console settings
You create a platform in the console. Its settings decide how Undertext presents and protects your product.
| Setting | What it does |
|---|---|
| Name | Shown wherever Undertext speaks for you, most visibly on seal pages: "Written in Acme Notes". |
| Slug | A short, permanent id, such as acme. It is part of your MCP address, https://mcp.undertext.sh/acme, so pick it once. |
| Embed origins | The origins allowed to show the editor, such as https://acme.com. The editor refuses to load in a frame anywhere else. |
| Consent URL | The page on your site where people approve an agent, such as https://acme.com/undertext/connect. See Agents. |
| Icon URL | The icon agents' apps show beside your platform's MCP server. |
| Document URL | Where your product shows a document, such as https://acme.com/docs/{document}, for links between documents and in agents' answers. |
| Seal URL | Where your product shows a seal, such as https://acme.com/seals/{code}. Seal links and seal lines name it. See Seals. |
| Domain | Your domain, such as acme.com, proved yours with a DNS record. Seal pages show it beside your name, "Acme Notes (acme.com, Verified)", and say "Unverified" without it. See Verify your domain. |
| Agent tools | Tools of your own that agents get beside Undertext's, set from your server. See Add your own agent tools. |
| Webhook endpoints | Where Undertext sends events. You can also manage these through the API. |
| Keys | Your secret keys. |
Everything but the slug and keys can be set from your server too, with PATCH /v1/platform and PUT /v1/platform/tools.
You can delete a platform in the console. Everything on it goes with it, its seals too.
Embed origins are enforced by the browser, not by a check you can forget. Undertext sends a frame-ancestors policy listing only your origins, and the editor framed there opens only your platform's documents, so another site can't put your users' editor in its page, even with a valid session token.
Secret keys
Your server calls the API with a secret key in the Authorization header:
curl https://api.undertext.sh/v1/users/usr_5Kq2Lm8R \
-H "Authorization: Bearer sk_51Hx…"A secret key can do anything on your platform, including start an editor session as any of your users. Keep it on your server. The browser never needs it: it gets a short-lived session token for one document instead.
Every key has a public id, such as key_3Fq9, shown beside it in the console. Undertext records which key started each writing session, and a seal lists the key ids behind it in attested_by. If a key ever leaks, that record tells you and anyone checking a seal which sessions it could have touched. The trust model explains why this matters.
A platform to try things on
Make one platform for development and CI, such as Acme Notes (dev), and another for your real users. Nothing moves between them: a document made on one can't be opened with the other's key, and the same external_id on each is two separate users, with different Undertext ids. See Go live.
Replacing a key
Replace a key in the console when someone who held it leaves, or on a schedule: create a new key, deploy it, and once the console shows the old key is no longer used, revoke it.
When you revoke a key because it leaked, every request with it stops at once. Seals record the ids of the keys that started their writing sessions, so you can find every seal it had a hand in.
Related
- Go live
- REST API overview: authentication, errors, limits and versions
- Trust model