Create or replace a record field value
Creates or replaces a field value on a business record, including optional evidence.
curl -X PUT "https://api.textmine.com/v3/records/123/field-values" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (`tm_<key>`)" \
-d '{
"fieldId": 9001,
"value": "England and Wales",
"normalizedValue": "england_and_wales",
"confidence": 0.94,
"status": "validated",
"sourceType": "document",
"sourceId": "67890",
"evidence": [
{
"documentId": 67890,
"pageNumber": 4,
"passageText": "This agreement is governed by the laws of England and Wales.",
"confidence": 0.94,
"validated": true
}
]
}'
import requests
import json
url = "https://api.textmine.com/v3/records/123/field-values"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (`tm_<key>`)"
}
data = {
"fieldId": 9001,
"value": "England and Wales",
"normalizedValue": "england_and_wales",
"confidence": 0.94,
"status": "validated",
"sourceType": "document",
"sourceId": "67890",
"evidence": [
{
"documentId": 67890,
"pageNumber": 4,
"passageText": "This agreement is governed by the laws of England and Wales.",
"confidence": 0.94,
"validated": true
}
]
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.textmine.com/v3/records/123/field-values", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (`tm_<key>`)"
},
body: JSON.stringify({
"fieldId": 9001,
"value": "England and Wales",
"normalizedValue": "england_and_wales",
"confidence": 0.94,
"status": "validated",
"sourceType": "document",
"sourceId": "67890",
"evidence": [
{
"documentId": 67890,
"pageNumber": 4,
"passageText": "This agreement is governed by the laws of England and Wales.",
"confidence": 0.94,
"validated": true
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"fieldId": 9001,
"value": "England and Wales",
"normalizedValue": "england_and_wales",
"confidence": 0.94,
"status": "validated",
"sourceType": "document",
"sourceId": "67890",
"evidence": [
{
"documentId": 67890,
"pageNumber": 4,
"passageText": "This agreement is governed by the laws of England and Wales.",
"confidence": 0.94,
"validated": true
}
]
}`)
req, err := http.NewRequest("PUT", "https://api.textmine.com/v3/records/123/field-values", 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/records/123/field-values')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (`tm_<key>`)'
request.body = '{
"fieldId": 9001,
"value": "England and Wales",
"normalizedValue": "england_and_wales",
"confidence": 0.94,
"status": "validated",
"sourceType": "document",
"sourceId": "67890",
"evidence": [
{
"documentId": 67890,
"pageNumber": 4,
"passageText": "This agreement is governed by the laws of England and Wales.",
"confidence": 0.94,
"validated": true
}
]
}'
response = http.request(request)
puts response.body
{
"id": 6001,
"teamId": 321,
"vaultId": 12345,
"schemaVersionId": 4001,
"recordTypeId": 5001,
"canonicalName": "Acme Ltd",
"status": "active",
"confidence": 0.91,
"fieldValues": []
}
{
"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/records/{recordId}/field-valuesTarget 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.Record ID.
The media type of the request body
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.
Path Parameters
Record ID.
Body
9001England and Walesengland_and_walesGBP0.94validateddocument67890Responses
Updated record.