Edit an artifact
curl --request POST \
--url https://api.tess.im/artifacts/{universal_id}/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"old": "<string>",
"new": "<string>",
"anchor": "<string>",
"text": "<string>",
"from": "<string>",
"to": "<string>",
"selector": "<string>",
"html": "<string>",
"name": "<string>",
"value": "<string>"
}
],
"base_version": 2
}
'import requests
url = "https://api.tess.im/artifacts/{universal_id}/edit"
payload = {
"operations": [
{
"old": "<string>",
"new": "<string>",
"anchor": "<string>",
"text": "<string>",
"from": "<string>",
"to": "<string>",
"selector": "<string>",
"html": "<string>",
"name": "<string>",
"value": "<string>"
}
],
"base_version": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
old: '<string>',
new: '<string>',
anchor: '<string>',
text: '<string>',
from: '<string>',
to: '<string>',
selector: '<string>',
html: '<string>',
name: '<string>',
value: '<string>'
}
],
base_version: 2
})
};
fetch('https://api.tess.im/artifacts/{universal_id}/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/artifacts/{universal_id}/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'old' => '<string>',
'new' => '<string>',
'anchor' => '<string>',
'text' => '<string>',
'from' => '<string>',
'to' => '<string>',
'selector' => '<string>',
'html' => '<string>',
'name' => '<string>',
'value' => '<string>'
]
],
'base_version' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tess.im/artifacts/{universal_id}/edit"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"old\": \"<string>\",\n \"new\": \"<string>\",\n \"anchor\": \"<string>\",\n \"text\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"selector\": \"<string>\",\n \"html\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"base_version\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tess.im/artifacts/{universal_id}/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"old\": \"<string>\",\n \"new\": \"<string>\",\n \"anchor\": \"<string>\",\n \"text\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"selector\": \"<string>\",\n \"html\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"base_version\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/artifacts/{universal_id}/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"old\": \"<string>\",\n \"new\": \"<string>\",\n \"anchor\": \"<string>\",\n \"text\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"selector\": \"<string>\",\n \"html\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"base_version\": 2\n}"
response = http.request(request)
puts response.read_body{
"universal_id": "<string>",
"version": 123,
"title": "<string>",
"viewer_url": "<string>"
}Artifacts
Edit Artifact
Applies patch operations to the latest version and writes a new version. Anchors and selectors must match exactly once. Send base_version to get 409 ARTIFACT_STALE instead of editing a newer version.
POST
/
artifacts
/
{universal_id}
/
edit
Edit an artifact
curl --request POST \
--url https://api.tess.im/artifacts/{universal_id}/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"old": "<string>",
"new": "<string>",
"anchor": "<string>",
"text": "<string>",
"from": "<string>",
"to": "<string>",
"selector": "<string>",
"html": "<string>",
"name": "<string>",
"value": "<string>"
}
],
"base_version": 2
}
'import requests
url = "https://api.tess.im/artifacts/{universal_id}/edit"
payload = {
"operations": [
{
"old": "<string>",
"new": "<string>",
"anchor": "<string>",
"text": "<string>",
"from": "<string>",
"to": "<string>",
"selector": "<string>",
"html": "<string>",
"name": "<string>",
"value": "<string>"
}
],
"base_version": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
old: '<string>',
new: '<string>',
anchor: '<string>',
text: '<string>',
from: '<string>',
to: '<string>',
selector: '<string>',
html: '<string>',
name: '<string>',
value: '<string>'
}
],
base_version: 2
})
};
fetch('https://api.tess.im/artifacts/{universal_id}/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/artifacts/{universal_id}/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'old' => '<string>',
'new' => '<string>',
'anchor' => '<string>',
'text' => '<string>',
'from' => '<string>',
'to' => '<string>',
'selector' => '<string>',
'html' => '<string>',
'name' => '<string>',
'value' => '<string>'
]
],
'base_version' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tess.im/artifacts/{universal_id}/edit"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"old\": \"<string>\",\n \"new\": \"<string>\",\n \"anchor\": \"<string>\",\n \"text\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"selector\": \"<string>\",\n \"html\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"base_version\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tess.im/artifacts/{universal_id}/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"old\": \"<string>\",\n \"new\": \"<string>\",\n \"anchor\": \"<string>\",\n \"text\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"selector\": \"<string>\",\n \"html\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"base_version\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/artifacts/{universal_id}/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"old\": \"<string>\",\n \"new\": \"<string>\",\n \"anchor\": \"<string>\",\n \"text\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"selector\": \"<string>\",\n \"html\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"base_version\": 2\n}"
response = http.request(request)
puts response.read_body{
"universal_id": "<string>",
"version": 123,
"title": "<string>",
"viewer_url": "<string>"
}Authenticate with a Tess API token in the
409
Authorization: Bearer header. See the Artifacts API guide for the full flow, permissions and ownership rules.
Code Examples
curl --request POST \
--url 'https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'x-workspace-id: YOUR_WORKSPACE_ID' \
--header 'Content-Type: application/json' \
--data '{
"base_version": 1,
"operations": [
{
"op": "replace",
"old": "$1.2M",
"new": "$1.4M"
}
]
}'
const axios = require('axios');
const config = {
method: 'post',
url: 'https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'x-workspace-id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json'
},
data: {
"base_version": 1,
"operations": [
{
"op": "replace",
"old": "$1.2M",
"new": "$1.4M"
}
]
}
};
try {
const response = await axios(config);
console.log(response.data);
} catch (error) {
console.error(error);
}
import requests
url = "https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"x-workspace-id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json"
}
payload = {
"base_version": 1,
"operations": [
{
"op": "replace",
"old": "$1.2M",
"new": "$1.4M"
}
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(["base_version" => 1, "operations" => [["op" => "replace", "old" => "\$1.2M", "new" => "\$1.4M"]]]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"x-workspace-id: YOUR_WORKSPACE_ID",
"Content-Type: application/json"
]
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Error: " . $err;
} else {
echo $response;
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("x-workspace-id", "YOUR_WORKSPACE_ID")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"base_version\": 1,\n \"operations\": [\n {\n \"op\": \"replace\",\n \"old\": \"$1.2M\",\n \"new\": \"$1.4M\"\n }\n ]\n}"))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("POST", "https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit", strings.NewReader(`{
"base_version": 1,
"operations": [
{
"op": "replace",
"old": "$1.2M",
"new": "$1.4M"
}
]
}`))
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
req.Header.Add("x-workspace-id", "YOUR_WORKSPACE_ID")
req.Header.Add("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");
var content = new StringContent(@"{
""base_version"": 1,
""operations"": [
{
""op"": ""replace"",
""old"": ""$1.2M"",
""new"": ""$1.4M""
}
]
}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit", content);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
}
require 'uri'
require 'net/http'
require 'json'
uri = URI('https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/edit')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['x-workspace-id'] = 'YOUR_WORKSPACE_ID'
request['Content-Type'] = 'application/json'
request.body = { 'base_version' => 1, 'operations' => [{ 'op' => 'replace', 'old' => '$1.2M', 'new' => '$1.4M' }] }.to_json
response = http.request(request)
puts response.read_body
Path Parameters
The artifact ID (
universal_id), for example artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f.Headers
Workspace ID. Required as of 2026-09-01. Until then, if omitted, the user’s selected workspace is used (deprecated). After the cutoff, a missing header returns 422.
Request Body
Version the edit is based on (minimum 1). If the latest version is newer, the call fails with 409.
One or more operations (at most 40). Each has
op: replace (old, new), insert_before / insert_after (anchor, text), replace_range (from, to, new), prepend / append (text), set_text (selector, text), replace_element (selector, html), set_attribute (selector, name, value) or remove_element (selector). Selector operations target one element of the content region.Response
200{
"universal_id": "artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f",
"version": 2,
"title": "Weekly pipeline",
"viewer_url": "https://tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f"
}
Response fields
Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid API token. |
403 | ARTIFACT_EDIT_FORBIDDEN: you can read the artifact but you are not its owner. Also ARTIFACT_FEATURE_DISABLED, ARTIFACT_PLAN_NOT_ALLOWED or ARTIFACT_ROLE_NOT_ALLOWED when the feature, plan or role does not allow artifacts. |
404 | ARTIFACT_NOT_FOUND: the artifact does not exist or is not yours. |
409 | ARTIFACT_STALE: the latest version is newer than base_version. Read the artifact again and redo the edit. |
422 | Validation error, ARTIFACT_EXTERNAL_RESOURCE, or an operation error: ARTIFACT_ANCHOR_NOT_FOUND, ARTIFACT_ANCHOR_AMBIGUOUS, ARTIFACT_SELECTOR_NOT_FOUND, ARTIFACT_SELECTOR_AMBIGUOUS, ARTIFACT_SELECTOR_INVALID, ARTIFACT_TOO_MANY_OPERATIONS, ARTIFACT_PATCH_TOO_LARGE, ARTIFACT_CONTENT_TOO_LARGE, ARTIFACT_INVALID_OPERATION. |
429 | Too many requests. Retry after a short wait. |
{
"error_code": "ARTIFACT_STALE",
"message": "Artifact is at version 2, edit was based on 1."
}
Authorizations
Body
application/json

