Create a provider document or upload files into Vault
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…
curl -X POST "https://api.textmine.com/v3/documents" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (`tm_<key>`)" \
-d '{
"provider": "notion",
"title": "Contract review note",
"blocks": [
"Review the limitation of liability clause."
],
"properties": {
"source": "api"
}
}'
import requests
import json
url = "https://api.textmine.com/v3/documents"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (`tm_<key>`)"
}
data = {
"provider": "notion",
"title": "Contract review note",
"blocks": [
"Review the limitation of liability clause."
],
"properties": {
"source": "api"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.textmine.com/v3/documents", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (`tm_<key>`)"
},
body: JSON.stringify({
"provider": "notion",
"title": "Contract review note",
"blocks": [
"Review the limitation of liability clause."
],
"properties": {
"source": "api"
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"provider": "notion",
"title": "Contract review note",
"blocks": [
"Review the limitation of liability clause."
],
"properties": {
"source": "api"
}
}`)
req, err := http.NewRequest("POST", "https://api.textmine.com/v3/documents", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (`tm_<key>`)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.textmine.com/v3/documents')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (`tm_<key>`)'
request.body = '{
"provider": "notion",
"title": "Contract review note",
"blocks": [
"Review the limitation of liability clause."
],
"properties": {
"source": "api"
}
}'
response = http.request(request)
puts response.body
{
"id": "notion-page-abc123",
"url": "https://www.notion.so/example/notion-page-abc123",
"providerId": "notion"
}
[
{
"id": 67890,
"name": "Acme supplier agreement.pdf",
"status": "processed",
"team_id": 321,
"vault_id": 12345,
"document_type_id": 777,
"mime_type": "application/pdf",
"size_bytes": 245760,
"page_count": 12,
"uploaded_at": "2024-12-25T10:00:00Z",
"processed_at": "2024-12-25T10:00:00Z"
}
]
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/v3/documents
Target server for requests. Edit to use your own host.
Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.
Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.The media type of the request body
Canonical provider ID used in paths, JSON bodies, and MCP tool parameters.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (tm_<key>). Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.
Body
Canonical provider ID used in paths, JSON bodies, and MCP tool parameters.
notiongoogle-drivesharepointContract review note["Review the limitation of liability clause.","Owner: Legal operations"]{"vault_id":"12345","source":"api"}Responses
This path supports two content types:
application/jsoncreates a document inside a connected outbound provider such as Notion.multipart/form-datauploads 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.