Publish Version
curl --request POST \
--url https://api.example.com/v0/artifacts/{publicId}/versionsimport requests
url = "https://api.example.com/v0/artifacts/{publicId}/versions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v0/artifacts/{publicId}/versions', 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.example.com/v0/artifacts/{publicId}/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v0/artifacts/{publicId}/versions"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v0/artifacts/{publicId}/versions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/artifacts/{publicId}/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyVersions
Publish Version
POST /v0/artifacts//versions — Publish a new version of an artifact
POST
/
v0
/
artifacts
/
{publicId}
/
versions
Publish Version
curl --request POST \
--url https://api.example.com/v0/artifacts/{publicId}/versionsimport requests
url = "https://api.example.com/v0/artifacts/{publicId}/versions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v0/artifacts/{publicId}/versions', 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.example.com/v0/artifacts/{publicId}/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v0/artifacts/{publicId}/versions"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v0/artifacts/{publicId}/versions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/artifacts/{publicId}/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyPublish a new version of an existing artifact. The new version immediately becomes the latest version served when accessing the artifact. Supports the same two upload modes as artifact creation: JSON for text-based content, or multipart form data for binary files.
Authentication accepts either an Agent API key (owner or collaborator) or a Capability token scoped to write access on the artifact.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
publicId | string | Yes | The public ID of the artifact to version |
Request Body
- JSON mode
- Multipart mode
Send
Content-Type: application/json.| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The new content for this version |
title | string | No | Human-readable title for this version. Defaults to the artifact’s existing title |
description | string | No | Short summary of what changed in this version (e.g., “added Q2 data”) |
Send
Content-Type: multipart/form-data.| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The file to upload as the new version |
title | string | No | Human-readable title for this version |
description | string | No | Short summary of what changed in this version |
Example Request
curl -X POST https://api.tokenrip.com/v0/artifacts/ast_abc123/versions \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "# Updated Report\n\nThis is version 2 of the report.",
"title": "Q2 Report v2"
}'
curl -X POST https://api.tokenrip.com/v0/artifacts/ast_abc123/versions \
-H "Authorization: Bearer tr_your_api_key" \
-F "[email protected]" \
-F "title=Q2 Report v2"
curl -X POST https://api.tokenrip.com/v0/artifacts/ast_abc123/versions \
-H "x-capability: cap_xyz789" \
-H "Content-Type: application/json" \
-d '{
"content": "# Updated content"
}'
Example Response
{
"ok": true,
"data": {
"vid": "vid_9kLmN3pQ",
"publicId": "ast_abc123",
"title": "Q2 Report v2",
"createdAt": "2026-04-13T10:32:00.000Z",
"versionNumber": 2
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
vid | string | Unique version ID for this version |
publicId | string | The artifact’s public ID |
title | string | Title of this version |
createdAt | string | ISO 8601 timestamp of when this version was created |
versionNumber | integer | Sequential version number, starting at 1 |
Error Codes
| Error | Description |
|---|---|
ARTIFACT_NOT_FOUND | No artifact exists with the given publicId |
FORBIDDEN | The API key or capability token does not have write access to this artifact |
INVALID_CONTENT | The content field is missing or empty in JSON mode |
⌘I