Agents, Public API, and MCP
TextMine supports two integration styles for agents and developer platforms:- Public API V3 is the primary integration path. Use it for signup, vaults, document types, uploads, tasks, records, workflows, agents, and billing.
- TextMine MCP server is optional. Use it only when the client wants MCP tool discovery and tool calls instead of direct REST calls.
Which Path Should I Use?
Self-Service Agent Signup
Use the Public API base URL for the environment. For the UK multitenant deployment:credentialRef: a non-secret reference such astextmine:api-key:123apiKeyPrefix: a display prefix that includestm_encryptedApiKey: the encrypted service-account API keyencryptedApiKeyAlgorithmencryptedApiKeyEncodingbillingStatusfreeCreditsPerPeriodsetupChecklist
encryptedApiKey in the trusted runtime, store the resulting tm_... key in a secret store, and keep the raw key out of model-visible prompts, task messages, logs, and transcripts.
Use the key on future Public API calls:
OpenAPI Spec
Yes: provide a Public API V3 OpenAPI spec and link it from the developer hub, agent guide, and MCP docs. Agents and developers use the OpenAPI spec for REST endpoint discovery, SDK generation, typed clients, API-client imports, and exact request/response shapes. Use the published API reference at developers.textmine.com/reference. The checked-in source for the agent self-service surface isdocs/openapi/textmine-public-api-v3-agent-self-service.openapi.json.
The Public API OpenAPI spec should include the full self-service bootstrap path:
GET /.well-known/textmine-agent.jsonGET /v3/third-party-agents/signup/discoveryPOST /v3/third-party-agents/signup/self-serviceGET /v3/agent-billing/statusPOST /v3/vaultsPOST /v3/document-typesPOST /v3/documentsPOST /v3/tasksPOST /v3/tasks/{taskId}/messages
initialize, tools/list, and tools/call. Connector platforms may need their own OpenAPI wrapper around /mcp, but that wrapper is not the canonical Public API spec.
REST-First Bootstrap Flow
After signup:- Check allowance and setup:
- Create the first vault:
- Create a document type:
- Upload a file:
vault_idis optional. If the agent omits it, TextMine reuses the first accessible vault or creates the defaultAgent Vaultfor that API-key organization before uploading the document. - Create and message a task:
- Re-check billing:
checkoutRequired=true, call POST /v3/agent-billing/checkout and send the returned Stripe Checkout URL to the billing owner so they can buy a one-time credit pack.
Optional TextMine MCP Server
The hosted TextMine MCP server is a Streamable HTTP MCP endpoint backed by Public API V3. Use the central setup URL:tm_... key used for Public API V3:
Authorization, such as some connector platforms, can send the key in the alternate header:
tm_... keys into prompts or app manifests.
https://public-api.textmine.com/.well-known/oauth-protected-resource.
Streamable HTTP requires a session handshake:
- Send
initializetohttps://mcp.textmine.com/mcp. - Keep the returned
mcp-session-idresponse header. - Send
notifications/initializedwithmcp-session-id. - Call
tools/listortools/callwithmcp-session-id.
tools/call without mcp-session-id is rejected.
Common Confusions
https://developers.textmine.com/mcpis the developer hub documentation MCP endpoint. It helps MCP-aware clients query API docs.- The TextMine product MCP server is the hosted endpoint used to call TextMine tools.
- Workbench MCP providers are third-party provider connections inside Workbench. They are not the TextMine product MCP server.
- Agent self-service signup is REST-first. MCP is never required for signup.
- The billing owner email collected during signup is a billing contact, not automatically a human web login.
Developer Documentation Checklist
Keep these phrases visible in page titles, descriptions, and first-screen copy:- TextMine Public API
- Public API V3
- OpenAPI spec
- agent self-service signup
- third-party agent API key
- service-account API key
- TextMine MCP server
- MCP setup
/.well-known/textmine-agent.json