curl --request POST \
--url https://api.autoprintfarm.com/public/v1/files/{id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"storage_key": "<string>",
"notes": "<string>",
"set_as_current": true
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/files/{id}/versions"
payload = {
"storage_key": "<string>",
"notes": "<string>",
"set_as_current": True
}
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({storage_key: '<string>', notes: '<string>', set_as_current: true})
};
fetch('https://api.autoprintfarm.com/public/v1/files/{id}/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.autoprintfarm.com/public/v1/files/{id}/versions",
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([
'storage_key' => '<string>',
'notes' => '<string>',
'set_as_current' => true
]),
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.autoprintfarm.com/public/v1/files/{id}/versions"
payload := strings.NewReader("{\n \"storage_key\": \"<string>\",\n \"notes\": \"<string>\",\n \"set_as_current\": true\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.autoprintfarm.com/public/v1/files/{id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"storage_key\": \"<string>\",\n \"notes\": \"<string>\",\n \"set_as_current\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/files/{id}/versions")
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 \"storage_key\": \"<string>\",\n \"notes\": \"<string>\",\n \"set_as_current\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"version_number": 123,
"notes": "<string>",
"is_current_version": true,
"created_at": "<string>"
}
}{
"success": true,
"data": {
"id": "<string>",
"version_number": 123,
"notes": "<string>",
"is_current_version": true,
"created_at": "<string>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}Add a new version to a file
Side effect: when set_as_current=true, the parent file is repointed at this new version; for a 3MF / G-code / binary G-code file its parsed metadata and thumbnail are cleared and a metadata extraction job is queued. The new version’s file extension must match the parent file’s extension.
Idempotent by storage_key: re-sending a storage_key this file already has a version for (e.g. retrying after a lost response) returns that existing version with 200 without modifying the file or its versions — notes and set_as_current on the retry are ignored. If that version is current and its metadata extraction has not finished, the retry queues extraction again. Version numbers are allocated server-side, so concurrent adds with different keys all succeed with distinct numbers, and a number freed by deleting a version is not handed out again (a file whose highest version was deleted before September 2026 may see that one number reused once).
If queuing the metadata extraction fails, the version is still stored and returned; extraction is re-delivered automatically.
curl --request POST \
--url https://api.autoprintfarm.com/public/v1/files/{id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"storage_key": "<string>",
"notes": "<string>",
"set_as_current": true
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/files/{id}/versions"
payload = {
"storage_key": "<string>",
"notes": "<string>",
"set_as_current": True
}
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({storage_key: '<string>', notes: '<string>', set_as_current: true})
};
fetch('https://api.autoprintfarm.com/public/v1/files/{id}/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.autoprintfarm.com/public/v1/files/{id}/versions",
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([
'storage_key' => '<string>',
'notes' => '<string>',
'set_as_current' => true
]),
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.autoprintfarm.com/public/v1/files/{id}/versions"
payload := strings.NewReader("{\n \"storage_key\": \"<string>\",\n \"notes\": \"<string>\",\n \"set_as_current\": true\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.autoprintfarm.com/public/v1/files/{id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"storage_key\": \"<string>\",\n \"notes\": \"<string>\",\n \"set_as_current\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/files/{id}/versions")
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 \"storage_key\": \"<string>\",\n \"notes\": \"<string>\",\n \"set_as_current\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"version_number": 123,
"notes": "<string>",
"is_current_version": true,
"created_at": "<string>"
}
}{
"success": true,
"data": {
"id": "<string>",
"version_number": 123,
"notes": "<string>",
"is_current_version": true,
"created_at": "<string>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}Authorizations
API keys are minted in the AutoPrintFarm web app under Settings → API Keys. Send as Authorization: Bearer apf_live_.... Keys are shown exactly once at creation and can be revoked at any time.
Path Parameters
Parent print file ID
Body
Tenant-scoped storage key of the uploaded version file. Extension must match the parent file.
1Free-form release notes (max 500 chars).
500If true (default), promote this version to current and repoint the parent file at it.
Was this page helpful?