Skip to content
undertext developers
Skip to Content
undertext developers
REST API

Platform

Your platform's settings, the agent tools of your own that Undertext's MCP server offers, and its counts.

Your platform's settings say where Undertext sends people and calls: the page where they approve agents, where your documents and seals are, which origins may frame the editor, and the tools of your own that agents get beside Undertext's. You can set them here, or all but your tools in the console; a server that sets them on starting keeps them in step with where it runs.

The platform object

AttributeTypeDescription
idstringYour platform's id.
slugstringIts short name, in your MCP address.
namestringWhat Undertext calls your platform: on consent and seal pages, and to agents.
icon_urlstring or nullYour icon, which MCP clients may show beside your server: Undertext's MCP server names it in serverInfo.icons when an agent connects.
embed_originsarrayThe origins that may frame the editor and presence settings. See Embed origins.
consent_urlstring or nullWhere Undertext sends people to approve an agent, with ?request=areq_…. See Agent requests. Without one, agents can't connect.
document_urlstring or nullWhere your product shows a document, with {document} for its id. Links between documents in the editor, and agents' answers, use it.
seal_urlstring or nullWhere your product shows a seal, with {code} for its code. Seals' url and seal lines name it. Without one, they name the seal's page on seal.undertext.sh. See Seals.
mcp_urlstringYour MCP address, for your users' agents.
domainstring or nullYour domain, such as acme.com. Seal pages show it beside your name once it's verified, and say "Unverified" until then. See Verify your domain.
domain_verifiedbooleanWhether Undertext found your domain's record, at its last look.
domain_recordobject or nullThe DNS record that proves domain is yours: type (TXT), name and value.
checkins_requiredbooleanWhether Verified Presence is required: everyone writing in your documents is asked to check in, and no one can turn it off. false unless you set it.
checkin_minutesintegerAbout how often your people are asked to check in while they write where Verified Presence is on: 1, 5, 10 or 30. 5 unless you set it. Your default, for anyone who hasn't chosen one of checkin_choices.
checkin_choicesarrayThe intervals your people may choose from in presence settings, checkin_minutes among them, sorted. Empty, as unless you set it, everyone is asked at checkin_minutes.
{
  "id": "plt_6Hq2Lm4R",
  "slug": "acme",
  "name": "Acme Notes",
  "icon_url": "https://acme.com/icon.png",
  "embed_origins": ["https://acme.com"],
  "consent_url": "https://acme.com/undertext/connect",
  "document_url": "https://acme.com/docs/{document}",
  "seal_url": "https://acme.com/seals/{code}",
  "mcp_url": "https://mcp.undertext.sh/acme",
  "domain": "acme.com",
  "domain_verified": true,
  "domain_record": { "type": "TXT", "name": "_undertext.acme.com", "value": "undertext-verification=Hq2Lm4R8Tb3Wc1X9Kp5Nz7Vd" },
  "checkins_required": false,
  "checkin_minutes": 5,
  "checkin_choices": [5, 10, 30]
}

Retrieve the platform

GET /v1/platform

curl https://api.undertext.sh/v1/platform \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY"

Update the platform

PATCH /v1/platform

Only the fields you send change. null removes a URL.

ParameterTypeDescription
namestringYour platform's name.
icon_urlstring or nullA URL of your icon, for MCP clients to show.
embed_originsarrayOrigins, such as https://acme.com; each is kept as its origin alone. https, except http on localhost and 127.0.0.1.
consent_urlstring or null
document_urlstring or nullWith {document} where the id goes.
seal_urlstring or nullWith {code} where the code goes. https, except http on localhost and 127.0.0.1.
domainstring or nullA domain name, such as acme.com. A new one gets a new record and is unverified until it's found.
checkins_requiredbooleantrue to require Verified Presence of everyone writing in your documents, even those without a key yet, whom the editor asks to add one.
checkin_minutesinteger1, 5, 10 or 30. Shorter asks more often, and each check-in vouches for less writing: about one and a half intervals. A seal's breakdown says how often its check-ins came.
checkin_choicesarrayIntervals your people may choose from, each 1, 5, 10 or 30; checkin_minutes is added if it's missing. [] for no choice. Someone whose choice you stop offering is asked at checkin_minutes, and at their choice again if you offer it again.
curl https://api.undertext.sh/v1/platform \
  -X PATCH \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"consent_url": "https://acme.com/undertext/connect", "document_url": "https://acme.com/docs/{document}"}'

Returns the platform.

ErrorWhen
400 invalid_parameterA URL that isn't one, embed_origins that aren't https origins (or http on localhost), a seal_url without {code}, a domain that isn't a domain name, checkins_required that isn't true or false, checkin_minutes that isn't one of 1, 5, 10 or 30, or checkin_choices that isn't a list of them.

Verify your domain

POST /v1/platform/verify-domain

Add domain_record to your domain's DNS, as a TXT record. Undertext looks for it each day, so a domain is verified within a day of the record appearing, and stops being verified once it's gone; keep the record for as long as you use the domain. This looks now instead. Returns the platform, with domain_verified as found.

ErrorWhen
409 no_domainThe platform has no domain.

Set your agent tools

PUT /v1/platform/tools

Gives your users' agents tools of your own, for what your product keeps itself, such as folders and pins. Undertext's MCP server lists them beside its own, and forwards each call to url, signed with secret. Each call replaces the tools you set before. See Add your own agent tools.

ParameterTypeDescription
urlstring, requiredWhere Undertext posts tool calls.
secretstring, requiredAt least 32 characters, which Undertext signs each call with. Choose it yourself and keep it.
toolsarray, requiredEach { name, title?, description, inputSchema }, as MCP describes a tool. Names are lowercase letters, digits and underscores, and can't be one of Undertext's own. Agents are shown each schema without additionalProperties or an empty properties, which Gemini can't read.
instructionsstringWhat agents are told of your tools, after Undertext's own instructions.
curl https://api.undertext.sh/v1/platform/tools \
  -X PUT \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://acme.com/undertext/tools",
    "secret": "'"$ACME_TOOLS_SECRET"'",
    "instructions": "Folders are the person'\''s own: list_folders shows them, move_document files a document in one.",
    "tools": [
      { "name": "list_folders", "description": "The person'\''s folders, in their order.", "inputSchema": { "type": "object", "properties": {} } }
    ]
  }'
{ "url": "https://acme.com/undertext/tools", "tools": ["list_folders"] }
ErrorWhen
400 invalid_parameter on urlNot a URL.
400 invalid_parameter on secretShorter than 32 characters.
400 invalid_parameter on toolsA tool lacks a name, description or input schema, or its name is one of Undertext's.

Retrieve counts

GET /v1/platform/stats

Counts for your own operations page: all time, and the last 7 days.

{
  "data": [
    { "label": "Documents", "total": 1204, "week": 87 },
    { "label": "Sealed documents", "total": 312, "week": 19 },
    { "label": "Agents", "total": 96, "week": 8 }
  ]
}

On this page