# TextMine API Documentation ## Guides - [Legislate Archive](https://developers.textmine.com/docs/contracts-1.md): Use Legislate for validated documents published from Vault. - [Document Ingestion](https://developers.textmine.com/docs/documents-2.md): Upload directly to Vault or import provider files through connected integrations. - [Vaults and Access](https://developers.textmine.com/docs/teams-1.md): Use Vault discovery and user/team endpoints before acting on documents. - [Users, Teams, and Assignees](https://developers.textmine.com/docs/users-1.md): Discover users before assigning reviews, approvals, workflows, and document ownership. - [Reports, Workflows, and Agents](https://developers.textmine.com/docs/vaults-1.md): Turn document intelligence into repeatable automation and structured outputs. - [TextMine Developer Overview](https://developers.textmine.com/docs/an-introduction-to-vault.md): A developer-oriented overview of the TextMine platform and current product surfaces. - [Documents and Validated Data](https://developers.textmine.com/docs/documents.md): How TextMine treats documents, metadata, tags, reports, records, and validated archive data. - [Document Lifecycle](https://developers.textmine.com/docs/how-does-vault-work.md): How documents move from upload or provider import through validation, automation, and publication. - [TextMine Mission](https://developers.textmine.com/docs/our-mission.md): Why TextMine exists and how the API supports reliable document intelligence. - [API Use Cases](https://developers.textmine.com/docs/use-cases.md): Common TextMine integration patterns for ingestion, reporting, workflows, records, and agents. - [Agent self-service signup](https://developers.textmine.com/docs/agent-self-service-signup.md): Provision a multitenant TextMine organization, service-account API key, and billing account for autonomous third-party agents. - [ChatGPT and OpenAI MCP Setup](https://developers.textmine.com/docs/chatgpt-mcp.md): Use TextMine as a remote MCP server from ChatGPT connectors or the OpenAI Responses API. - [Claude MCP Setup](https://developers.textmine.com/docs/claude-mcp.md): Connect Claude-compatible MCP clients to TextMine using the remote MCP URL. - [Codex MCP Setup](https://developers.textmine.com/docs/codex-mcp.md): Connect Codex to TextMine with a remote MCP server and environment-backed bearer token. - [Core Concepts](https://developers.textmine.com/docs/concepts.md): How Vault, Legislate, Workbench, Workflows, integrations, and agents fit together. - [Cursor and Windsurf MCP Setup](https://developers.textmine.com/docs/cursor-windsurf-mcp.md): Configure editor agents to use TextMine MCP for docs discovery and API execution. - [For Agents](https://developers.textmine.com/docs/for-agents.md): Canonical TextMine instructions for agents using Public API V3, MCP, llms.txt, and agent self-service signup. - [Public API Quickstart](https://developers.textmine.com/docs/getting-started.md): Make your first TextMine Public API v3 calls and give agents a reliable starting path. - [ReadMe and TextMine MCP Quickstart](https://developers.textmine.com/docs/textmine-mcp.md): Connect MCP-compatible clients to TextMine developer docs, Public API V3, and the hosted TextMine MCP server. ## API Reference - [Create an agent billing checkout session](https://developers.textmine.com/reference/createagentbillingcheckoutsession.md): Creates a Stripe checkout session so a third-party agent organization can upgrade from free credit to paid usage. - [Create an agent billing portal session](https://developers.textmine.com/reference/createagentbillingportalsession.md): Creates a Stripe billing portal session so a third-party agent organization can manage payment details and subscription state. - [Get agent billing status](https://developers.textmine.com/reference/getagentbillingstatus.md): Returns free-credit, checkout, and portal status for the authenticated third-party agent organization. - [Get document plain text](https://developers.textmine.com/reference/getdocumentplaintext.md): Returns the extracted plain text for a processed document so agents can inspect, summarize, or cite document content. - [List document tag source chunks](https://developers.textmine.com/reference/listdocumenttagsourcechunks.md): Returns the extracted source text chunks associated with the latest answer for a document tag, including page and offset metadata for agent citations. - [Create an agent self-service organization](https://developers.textmine.com/reference/createagentselfservicesignup.md): Creates a third-party agent organization, service-account API key, and billing account. Use credentialDeliveryPublicKey for encrypted API-key delivery. - [Get agent self-service discovery metadata](https://developers.textmine.com/reference/getagentselfservicediscovery.md): Returns signup, billing, Public API, and MCP metadata for autonomous third-party agents. - [Get agent self-service signup availability](https://developers.textmine.com/reference/getagentselfservicesignupavailability.md): Returns whether autonomous third-party agent signup is enabled for this TextMine environment. - [Get TextMine agent well-known discovery metadata](https://developers.textmine.com/reference/gettextmineagentwellknowndiscovery.md): Returns public machine-readable agent signup, billing, Public API, and MCP metadata. - [Create a document type](https://developers.textmine.com/reference/createdocumenttype-1.md): Creates a custom document type and optionally seeds default extraction questions for one or more Vaults. - [Create a vault workspace](https://developers.textmine.com/reference/createvaultworkspace.md): Creates a Vault. If teamId is omitted, creates a new team-backed Vault workspace for the authenticated self-service agent organization. - [Upload a document](https://developers.textmine.com/reference/uploaddocument.md): Uploads a file as multipart form data. vault_id is optional: omit it to reuse the first accessible vault or create the default Agent Vault workspace for the API-key organization. For typed processing, pass document_type_id. ZIP files may expand into multiple created documents. - [Add a task message](https://developers.textmine.com/reference/addtaskmessage.md): Adds a follow-up instruction or clarification to an existing task. - [Create a long-running task](https://developers.textmine.com/reference/createtask.md): Creates a long-running TextMine task for Workbench/task-agent work. - [Create an agent](https://developers.textmine.com/reference/createagent.md): Magic agent endpoint. A single POST creates the agent, agent configuration, and either a general-action prompt or confidence-based action rule. - [Create a contract alert](https://developers.textmine.com/reference/createcontractalert.md): Magic create endpoint. Provide an alert `kind` and either `params` or inlined per-kind keys. The service derives `fires_at`, defaults recipients to the contract creator, and defaults the channel to email. - [Cancel an alert](https://developers.textmine.com/reference/deletealert.md): Cancels/deletes an alert. - [Fetch an alert](https://developers.textmine.com/reference/getalert.md): Fetches a single alert by ID. - [List alert kinds](https://developers.textmine.com/reference/listalertkinds.md): Lists the alert kind catalog and parameter schemas. Use this before creating contract alerts. - [List alerts for a Legislate contract](https://developers.textmine.com/reference/listcontractalerts.md): Lists alerts scheduled for a contract, ordered by `fires_at` ascending. Legislate remains the validated-data archive where Vault documents can be published. - [Update an alert](https://developers.textmine.com/reference/updatealert.md): Updates an alert name, params, recipients, or channel. `kind` and `contract_id` are immutable. - [Create an API key for the authenticated user](https://developers.textmine.com/reference/createownapikey.md): Issues a TextMine API key for the authenticated user. The raw `tm_...` key is returned only once in this response; store it securely and never paste it into docs, code, or chat logs. - [Add a document assignee](https://developers.textmine.com/reference/adddocumentassignee.md): Adds a reviewer or assignee to a document. Provide either `userId` when known or an email address when assigning by email. - [List document assignees](https://developers.textmine.com/reference/listdocumentassignees.md): Lists users assigned to review or own a document. - [Remove a document assignee](https://developers.textmine.com/reference/removedocumentassignee.md): Removes a user assignment from a document. - [Activate a schema version](https://developers.textmine.com/reference/activaterecordschemaversion.md): Marks a schema version as active. - [Create a business record](https://developers.textmine.com/reference/createbusinessrecord.md): Creates a structured business record with optional field values and evidence. - [Create a business record schema](https://developers.textmine.com/reference/createrecordschema.md): Creates a schema that defines structured record types, fields, and relationships for a team or Vault. - [Soft-delete a business record](https://developers.textmine.com/reference/deletebusinessrecord.md): Soft-deletes a business record. - [Soft-delete a record schema](https://developers.textmine.com/reference/deleterecordschema.md): Soft-deletes a business record schema. - [Fetch a business record](https://developers.textmine.com/reference/getbusinessrecord.md): Fetches a business record. - [Fetch a record schema](https://developers.textmine.com/reference/getrecordschema.md): Fetches a business record schema. - [List records for a schema version](https://developers.textmine.com/reference/listbusinessrecords.md): Lists business records created for a schema version, optionally including candidate records and filtering by status or search text. - [List business record schemas](https://developers.textmine.com/reference/listrecordschemas.md): Lists business record schemas for a team. - [Replace a schema version definition](https://developers.textmine.com/reference/replacerecordschemaversion.md): Replaces the record type and relationship definitions for a schema version. - [Suggest a business record schema](https://developers.textmine.com/reference/suggestrecordschema.md): Creates a suggested schema from a prompt or supplied definition. - [Create or replace a record field value](https://developers.textmine.com/reference/upsertbusinessrecordfieldvalue.md): Creates or replaces a field value on a business record, including optional evidence. - [Create a document type](https://developers.textmine.com/reference/createdocumenttype.md): Route exists but is not wired yet because organization and contract-type-group context still need mapping. - [Delete a custom document type](https://developers.textmine.com/reference/deletedocumenttype.md): Deletes a custom document type. Built-in/non-custom document types return an error from the service. - [Fetch a document type](https://developers.textmine.com/reference/getdocumenttype.md): Fetches a Vault-scoped document type. Pass `vault_id` while flat lookup is pending. - [List document types](https://developers.textmine.com/reference/listdocumenttypes.md): Lists document types reachable from a Vault. Org-wide listing is not wired yet, so pass `vault_id`. - [Update a document type](https://developers.textmine.com/reference/updatedocumenttype.md): Route exists but is not wired yet pending mapping for document-type vault settings. - [Create a provider document or upload files into Vault](https://developers.textmine.com/reference/createoruploaddocument.md): This path supports two content types: - `application/json` creates a document inside a connected outbound provider such as Notion. - `multipart/form-data` uploads a file into TextMine Vault and starts the magic upload pipeline. ZIP files expand into multiple documents. Agents should choose the content type based on the task. To import a file from Google Drive or SharePoint into Vault without downloading it locally, use `importDocumentFromProvider` instead. - [Delete a document](https://developers.textmine.com/reference/deletedocument.md): Deletes a document from Vault. - [Fetch a document](https://developers.textmine.com/reference/getdocument.md): Fetches the public metadata for a document. - [Import a provider file into Vault](https://developers.textmine.com/reference/importdocumentfromprovider.md): Imports a file from a connected outbound provider into a TextMine Vault. The server uses the user stored OAuth token, fetches the file, and feeds it into the same magic upload pipeline as direct uploads. - [List documents in a vault](https://developers.textmine.com/reference/listdocuments.md): Lists documents for a Vault, optionally filtered by document type and processing status. Returns only documents with an active imported-contract record. - [Re-run document processing](https://developers.textmine.com/reference/reprocessdocument.md): Queues the document processing pipeline again and returns the current document metadata with `202 Accepted`. - [Update document metadata](https://developers.textmine.com/reference/updatedocument.md): Renames a document, changes its document type, and optionally queues reprocessing. - [Export vault documents as CSV](https://developers.textmine.com/reference/exportvaultcsv.md): Exports selected documents, or all documents in a Vault, as CSV. Optional headers control which columns are included. - [Export vault documents as PDF or ZIP](https://developers.textmine.com/reference/exportvaultpdf.md): Exports a single selected document as PDF, or multiple selected documents as a ZIP of original files. - [Check Public API V3 health](https://developers.textmine.com/reference/checkv3health.md): Returns a small JSON payload confirming the public API is responding and serving v3 routes. - [Start provider OAuth](https://developers.textmine.com/reference/authorizeintegrationprovider.md): Returns the upstream authorization URL the user must visit to grant access to the selected provider. - [Disconnect a provider](https://developers.textmine.com/reference/disconnectintegrationprovider.md): Disconnects the calling user integration with the provider. - [Get provider connection status](https://developers.textmine.com/reference/getintegrationproviderstatus.md): Returns the calling user connection status and provider metadata. - [Provider OAuth callback](https://developers.textmine.com/reference/handleintegrationoauthcallback.md): Browser redirect target for provider OAuth. The user is derived from the persisted one-time `state` value. This is documented for completeness; API clients and agents usually do not call it directly. - [List files in a provider folder](https://developers.textmine.com/reference/listintegrationfolderfiles.md): Lists files in a connected provider folder. Use returned `id` values as `external_file_id` when importing to Vault. - [List provider folders](https://developers.textmine.com/reference/listintegrationfolders.md): Lists folders available in a connected file-storage integration. - [List integration providers](https://developers.textmine.com/reference/listintegrationproviders.md): Returns outbound integration providers supported by TextMine, annotated with the calling user connection status. Current provider IDs are `notion`, `google-drive`, and `sharepoint`. - [Fetch one metadata field](https://developers.textmine.com/reference/getdocumentmetadatafield.md): Fetches a single extracted metadata field and its citations. - [List document metadata fields](https://developers.textmine.com/reference/listdocumentmetadata.md): Lists extracted metadata fields for a document, including confidence and citations where available. - [Override a metadata field](https://developers.textmine.com/reference/updatedocumentmetadatafield.md): Updates a metadata field value or status, typically after human validation. - [Count vault reports](https://developers.textmine.com/reference/countvaultreports.md): Counts reports stored for a Vault. - [Create a report template](https://developers.textmine.com/reference/createreporttemplate.md): Saves a custom report template for reuse. - [Soft-delete a report](https://developers.textmine.com/reference/deletereport.md): Soft-deletes a report. - [Delete a custom report template](https://developers.textmine.com/reference/deletereporttemplate.md): Deletes a custom report template. System templates cannot be deleted. - [Export a report as DOCX](https://developers.textmine.com/reference/exportreportdocx.md): Exports a completed report as a Word document attachment. - [Export a report as PDF](https://developers.textmine.com/reference/exportreportpdf.md): Exports a completed report as a PDF attachment. - [Export team reports as CSV](https://developers.textmine.com/reference/exportteamreportscsv.md): Exports all reports for a team as a CSV attachment. - [Generate a report](https://developers.textmine.com/reference/generatereport.md): Magic report endpoint. Provide either explicit `document_ids`, or a `vault_id` to use the latest `document_limit` Vault documents. `analyze_instruction=true` can auto-create missing tags before running. - [Fetch a report](https://developers.textmine.com/reference/getreport.md): Fetches a report. Poll this endpoint until `status` is `COMPLETED` or `FAILED`. - [Fetch a report template](https://developers.textmine.com/reference/getreporttemplate.md): Fetches a single report template. - [List reports for a vault](https://developers.textmine.com/reference/listreports.md): Lists reports for a Vault, newest first. - [List report templates](https://developers.textmine.com/reference/listreporttemplates.md): Lists system and custom report templates available for a Vault. - [Search documents with a JSON body](https://developers.textmine.com/reference/searchdocuments.md): Searches documents with the same filters as GET. Prefer POST when filters are complex or arrays are large. - [Search documents with query parameters](https://developers.textmine.com/reference/searchdocumentsget.md): Searches documents by text query, team IDs, Vault IDs, document type IDs, status, and publication date range. - [Add tags to a document](https://developers.textmine.com/reference/adddocumenttags.md): Route exists but is not wired yet pending the async tag-pipeline mapping. - [Clear tag validation](https://developers.textmine.com/reference/cleardocumenttagvalidation.md): Clears validation flags on a tag answer for this document. - [Create a vault tag](https://developers.textmine.com/reference/createvaulttag.md): Route exists but is not wired yet pending custom-question request mapping. - [Soft-delete a vault tag](https://developers.textmine.com/reference/deletevaulttag.md): Soft-deletes a vault-scoped custom tag. - [Fetch a vault tag](https://developers.textmine.com/reference/getvaulttag.md): Fetches a custom tag scoped to a Vault. - [List document tag answers](https://developers.textmine.com/reference/listdocumenttags.md): Lists the tags attached to a document with latest answers and validation state. - [List vault tags](https://developers.textmine.com/reference/listvaulttags.md): Lists custom tags scoped to a Vault. - [Update a vault tag](https://developers.textmine.com/reference/updatevaulttag.md): Route exists but is not wired yet pending v3 patch semantics. - [Validate a document tag answer](https://developers.textmine.com/reference/validatedocumenttag.md): Marks a tag answer as valid or invalid. Pass `validated_answer` to override the AI answer. - [Fetch a team user](https://developers.textmine.com/reference/getteamuser.md): Fetches a user that belongs to a team. - [Fetch a vault user](https://developers.textmine.com/reference/getvaultuser.md): Fetches a user that belongs to the Vault team. - [List users in a team](https://developers.textmine.com/reference/listteamusers.md): Lists users that belong to a team. Useful before assigning reviewers or workflow actions. - [List users in a vault team](https://developers.textmine.com/reference/listvaultusers.md): Lists users that belong to the Vault team. - [Create a vault for an existing team](https://developers.textmine.com/reference/createvault.md): Creates a Vault attached to an existing team. The `name` and `description` update the underlying team record before the Vault is created. - [Soft-delete a vault](https://developers.textmine.com/reference/deletevault.md): Marks a Vault as deleted. Repeating the request for a missing or already deleted Vault returns `204`. - [Fetch a vault](https://developers.textmine.com/reference/getvault.md): Returns a single non-deleted Vault by ID. - [List accessible vaults](https://developers.textmine.com/reference/listvaults.md): Lists every Vault visible to the authenticated API-key user. Use this before document upload, search, reports, or provider import when an agent does not already know the `vault_id`. - [Update a vault name or description](https://developers.textmine.com/reference/updatevault.md): Updates a Vault display name and description. These values are stored on the underlying team record. - [Create an enabled workflow](https://developers.textmine.com/reference/createworkflow.md): Magic workflow endpoint. A single POST creates an enabled linear workflow graph: trigger, condition, then action. Use the catalog endpoints to choose valid `kind` values and params. - [List workflow actions](https://developers.textmine.com/reference/listworkflowactions.md): Catalog of action kinds accepted by the magic workflow endpoint. - [List workflow conditions](https://developers.textmine.com/reference/listworkflowconditions.md): Catalog of condition kinds accepted by the magic workflow endpoint. - [List workflow triggers](https://developers.textmine.com/reference/listworkflowtriggers.md): Catalog of trigger kinds accepted by the magic workflow endpoint. ## Changelog - [Public API v3 and MCP documentation updates](https://developers.textmine.com/changelog/public-api-v3-and-mcp-documentation-updates.md) - [Welcome to Vault](https://developers.textmine.com/changelog/welcome-to-vault.md)