Change a workspace
Make one new version of a workspace from its current one: text files written whole (write), find-and-replace edits (patch, each find must occur exactly once), other files by hash (files, missing ones get a PUT link), delete, or restore an earlier bundle. Send expected_bundle (from graphics_list) and a workspace that moved on answers 409 with nothing changed. Up to 200 changes a call. Files are stored, never run. Free. See Motion graphics.
curl --request POST \
--url https://api.vidjutsu.ai/graphics/workspaces/{workspace} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"delete": [],
"expected_bundle": null,
"files": [],
"patch": [
{
"find": "<string>",
"path": "<string>",
"replace": "<string>"
}
],
"restore": null,
"write": [
{
"path": "<string>",
"text": "<string>"
}
]
}
'import requests
url = "https://api.vidjutsu.ai/graphics/workspaces/{workspace}"
payload = {
"delete": [],
"expected_bundle": None,
"files": [],
"patch": [
{
"find": "<string>",
"path": "<string>",
"replace": "<string>"
}
],
"restore": None,
"write": [
{
"path": "<string>",
"text": "<string>"
}
]
}
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({
delete: [],
expected_bundle: null,
files: [],
patch: [{find: '<string>', path: '<string>', replace: '<string>'}],
restore: null,
write: [{path: '<string>', text: '<string>'}]
})
};
fetch('https://api.vidjutsu.ai/graphics/workspaces/{workspace}', 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.vidjutsu.ai/graphics/workspaces/{workspace}",
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([
'delete' => [
],
'expected_bundle' => null,
'files' => [
],
'patch' => [
[
'find' => '<string>',
'path' => '<string>',
'replace' => '<string>'
]
],
'restore' => null,
'write' => [
[
'path' => '<string>',
'text' => '<string>'
]
]
]),
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.vidjutsu.ai/graphics/workspaces/{workspace}"
payload := strings.NewReader("{\n \"delete\": [],\n \"expected_bundle\": null,\n \"files\": [],\n \"patch\": [\n {\n \"find\": \"<string>\",\n \"path\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"restore\": null,\n \"write\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\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.vidjutsu.ai/graphics/workspaces/{workspace}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"delete\": [],\n \"expected_bundle\": null,\n \"files\": [],\n \"patch\": [\n {\n \"find\": \"<string>\",\n \"path\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"restore\": null,\n \"write\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidjutsu.ai/graphics/workspaces/{workspace}")
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 \"delete\": [],\n \"expected_bundle\": null,\n \"files\": [],\n \"patch\": [\n {\n \"find\": \"<string>\",\n \"path\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"restore\": null,\n \"write\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bundle": "<string>",
"bytes": 123,
"expires_at": 123,
"files": 123,
"missing": [
{
"bytes": 123,
"paths": [
"<string>"
],
"put_url": "<string>",
"sha256": "<string>"
}
],
"stored_inline": 123,
"version": 123,
"workspace": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}Authorizations
Headers
The API version you wrote your integration against, a date. Without it you get the latest version. The current version is 2026-11-03. See https://docs.vidjutsu.ai/api-reference/introduction#versioning.
^\d{4}-\d{2}-\d{2}$"2026-11-03"
Path Parameters
Body
One new version of the workspace, made from the current one and these changes. Every field is optional.
Response
The new version
curl --request POST \
--url https://api.vidjutsu.ai/graphics/workspaces/{workspace} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"delete": [],
"expected_bundle": null,
"files": [],
"patch": [
{
"find": "<string>",
"path": "<string>",
"replace": "<string>"
}
],
"restore": null,
"write": [
{
"path": "<string>",
"text": "<string>"
}
]
}
'import requests
url = "https://api.vidjutsu.ai/graphics/workspaces/{workspace}"
payload = {
"delete": [],
"expected_bundle": None,
"files": [],
"patch": [
{
"find": "<string>",
"path": "<string>",
"replace": "<string>"
}
],
"restore": None,
"write": [
{
"path": "<string>",
"text": "<string>"
}
]
}
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({
delete: [],
expected_bundle: null,
files: [],
patch: [{find: '<string>', path: '<string>', replace: '<string>'}],
restore: null,
write: [{path: '<string>', text: '<string>'}]
})
};
fetch('https://api.vidjutsu.ai/graphics/workspaces/{workspace}', 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.vidjutsu.ai/graphics/workspaces/{workspace}",
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([
'delete' => [
],
'expected_bundle' => null,
'files' => [
],
'patch' => [
[
'find' => '<string>',
'path' => '<string>',
'replace' => '<string>'
]
],
'restore' => null,
'write' => [
[
'path' => '<string>',
'text' => '<string>'
]
]
]),
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.vidjutsu.ai/graphics/workspaces/{workspace}"
payload := strings.NewReader("{\n \"delete\": [],\n \"expected_bundle\": null,\n \"files\": [],\n \"patch\": [\n {\n \"find\": \"<string>\",\n \"path\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"restore\": null,\n \"write\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\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.vidjutsu.ai/graphics/workspaces/{workspace}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"delete\": [],\n \"expected_bundle\": null,\n \"files\": [],\n \"patch\": [\n {\n \"find\": \"<string>\",\n \"path\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"restore\": null,\n \"write\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidjutsu.ai/graphics/workspaces/{workspace}")
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 \"delete\": [],\n \"expected_bundle\": null,\n \"files\": [],\n \"patch\": [\n {\n \"find\": \"<string>\",\n \"path\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"restore\": null,\n \"write\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bundle": "<string>",
"bytes": 123,
"expires_at": 123,
"files": 123,
"missing": [
{
"bytes": 123,
"paths": [
"<string>"
],
"put_url": "<string>",
"sha256": "<string>"
}
],
"stored_inline": 123,
"version": 123,
"workspace": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}