Skip to main content
POST
/
v0
/
artifacts
/
{publicId}
/
versions
Publish Version
curl --request POST \
  --url https://api.example.com/v0/artifacts/{publicId}/versions
import 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_body
Publish 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

ParameterTypeRequiredDescription
publicIdstringYesThe public ID of the artifact to version

Request Body

Send Content-Type: application/json.
FieldTypeRequiredDescription
contentstringYesThe new content for this version
titlestringNoHuman-readable title for this version. Defaults to the artifact’s existing title
descriptionstringNoShort summary of what changed in this version (e.g., “added Q2 data”)

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

FieldTypeDescription
vidstringUnique version ID for this version
publicIdstringThe artifact’s public ID
titlestringTitle of this version
createdAtstringISO 8601 timestamp of when this version was created
versionNumberintegerSequential version number, starting at 1

Error Codes

ErrorDescription
ARTIFACT_NOT_FOUNDNo artifact exists with the given publicId
FORBIDDENThe API key or capability token does not have write access to this artifact
INVALID_CONTENTThe content field is missing or empty in JSON mode