Assets
Reorder Version Stack
Reorder assets within a version stack.
The last element of ordered_asset_ids becomes the new top version. Returns 409 with conflict details if the new top’s name conflicts with an existing item and no conflict_resolutions are provided.
POST
/
assets
/
versions
/
reorder
Reorder Version Stack
curl --request POST \
--url https://api.aspect.inc/assets/versions/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ordered_asset_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"conflict_resolutions": {}
}
'import requests
url = "https://api.aspect.inc/assets/versions/reorder"
payload = {
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ordered_asset_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"conflict_resolutions": {}
}
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({
version_stack_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ordered_asset_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
conflict_resolutions: {}
})
};
fetch('https://api.aspect.inc/assets/versions/reorder', 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.aspect.inc/assets/versions/reorder",
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([
'version_stack_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ordered_asset_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'conflict_resolutions' => [
]
]),
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.aspect.inc/assets/versions/reorder"
payload := strings.NewReader("{\n \"version_stack_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ordered_asset_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"conflict_resolutions\": {}\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.aspect.inc/assets/versions/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_stack_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ordered_asset_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"conflict_resolutions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aspect.inc/assets/versions/reorder")
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 \"version_stack_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ordered_asset_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"conflict_resolutions\": {}\n}"
response = http.request(request)
puts response.read_body{
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assets": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"name": "<string>",
"size_bytes": 123,
"mime_type": "<string>",
"save_original": true,
"is_uploaded": true,
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"comment_count": 123,
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"is_symlink": false,
"target_path": [
"<string>"
],
"target_path_type": "relative",
"target_resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_resource_name": "<string>",
"target_resource_type": "workspace",
"target_resolution_status": "resolved",
"duration": 123,
"page_count": 123,
"path": [
"<string>"
],
"features": {},
"actions": 123,
"stream_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"scrub_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"audio_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"doc_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"scrub_preview": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"scrub_metadata": {
"frame_count": 123,
"width": 123,
"height": 123,
"frames_x": 123,
"frames_y": 123,
"frame_width": 123,
"frame_height": 123
}
},
"preview": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"scrub_metadata": {
"frame_count": 123,
"width": 123,
"height": 123,
"frames_x": 123,
"frames_y": 123,
"frame_width": 123,
"frame_height": 123
}
},
"created_by_user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
},
"client_performed_at": "2023-11-07T05:31:56Z",
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"is_top_version": true,
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_latest": true
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
BearerAuthApiKeyAuth
JWT in Authorization header. 'Bearer ' prefix optional.
Body
application/json
API request to reorder assets within a version stack
ID of the version stack to reorder
Ordered list of asset IDs. Position 0 = version 1 (bottom), last = top version.
Resolution strategies for name conflicts when a new top version's name re-enters the uniqueness constraint. Keys are string UUIDs of conflicting items. If not provided and conflicts exist, returns 409.
Show child attributes
Show child attributes
⌘I
Reorder Version Stack
curl --request POST \
--url https://api.aspect.inc/assets/versions/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ordered_asset_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"conflict_resolutions": {}
}
'import requests
url = "https://api.aspect.inc/assets/versions/reorder"
payload = {
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ordered_asset_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"conflict_resolutions": {}
}
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({
version_stack_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ordered_asset_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
conflict_resolutions: {}
})
};
fetch('https://api.aspect.inc/assets/versions/reorder', 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.aspect.inc/assets/versions/reorder",
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([
'version_stack_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ordered_asset_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'conflict_resolutions' => [
]
]),
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.aspect.inc/assets/versions/reorder"
payload := strings.NewReader("{\n \"version_stack_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ordered_asset_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"conflict_resolutions\": {}\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.aspect.inc/assets/versions/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_stack_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ordered_asset_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"conflict_resolutions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aspect.inc/assets/versions/reorder")
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 \"version_stack_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ordered_asset_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"conflict_resolutions\": {}\n}"
response = http.request(request)
puts response.read_body{
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assets": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"name": "<string>",
"size_bytes": 123,
"mime_type": "<string>",
"save_original": true,
"is_uploaded": true,
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"comment_count": 123,
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"is_symlink": false,
"target_path": [
"<string>"
],
"target_path_type": "relative",
"target_resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_resource_name": "<string>",
"target_resource_type": "workspace",
"target_resolution_status": "resolved",
"duration": 123,
"page_count": 123,
"path": [
"<string>"
],
"features": {},
"actions": 123,
"stream_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"scrub_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"audio_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"doc_proxy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"playback_mode": "mp4",
"size_bytes": 123
},
"scrub_preview": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"scrub_metadata": {
"frame_count": 123,
"width": 123,
"height": 123,
"frames_x": 123,
"frames_y": 123,
"frame_width": 123,
"frame_height": 123
}
},
"preview": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z",
"scrub_metadata": {
"frame_count": 123,
"width": 123,
"height": 123,
"frames_x": 123,
"frames_y": 123,
"frame_width": 123,
"frame_height": 123
}
},
"created_by_user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
},
"client_performed_at": "2023-11-07T05:31:56Z",
"version_stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"is_top_version": true,
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_latest": true
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
