curl --request PUT \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Content-Type: application/json' \
--data '
{
"asset_name": "Front view approved",
"metadata": {
"approved_by": "creative-team"
}
}
'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
payload = {
"asset_name": "Front view approved",
"metadata": { "approved_by": "creative-team" }
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({asset_name: 'Front view approved', metadata: {approved_by: 'creative-team'}})
};
fetch('https://api.tokenlab.sh/v1/videos/assets/{assetId}', 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.tokenlab.sh/v1/videos/assets/{assetId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset_name' => 'Front view approved',
'metadata' => [
'approved_by' => 'creative-team'
]
]),
CURLOPT_HTTPHEADER => [
"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.tokenlab.sh/v1/videos/assets/{assetId}"
payload := strings.NewReader("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Content-Type", "application/json")
.body("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view approved",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": {
"approved_by": "creative-team"
},
"created_at": 1782998400000
}{
"error": {
"message": "model: Model is required",
"type": "invalid_request_error",
"param": "model"
},
"validation_errors": [
{
"field": "model",
"message": "Model is required"
}
]
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "Image width must be between 300px and 6000px.",
"type": "invalid_request_error",
"code": "seedance_material_source_invalid",
"param": "asset_url"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}Mettre à jour un actif matériel
Met à jour un actif matériel Seedance appartenant à l’organisation actuelle.
curl --request PUT \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Content-Type: application/json' \
--data '
{
"asset_name": "Front view approved",
"metadata": {
"approved_by": "creative-team"
}
}
'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
payload = {
"asset_name": "Front view approved",
"metadata": { "approved_by": "creative-team" }
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({asset_name: 'Front view approved', metadata: {approved_by: 'creative-team'}})
};
fetch('https://api.tokenlab.sh/v1/videos/assets/{assetId}', 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.tokenlab.sh/v1/videos/assets/{assetId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset_name' => 'Front view approved',
'metadata' => [
'approved_by' => 'creative-team'
]
]),
CURLOPT_HTTPHEADER => [
"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.tokenlab.sh/v1/videos/assets/{assetId}"
payload := strings.NewReader("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Content-Type", "application/json")
.body("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view approved",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": {
"approved_by": "creative-team"
},
"created_at": 1782998400000
}{
"error": {
"message": "model: Model is required",
"type": "invalid_request_error",
"param": "model"
},
"validation_errors": [
{
"field": "model",
"message": "Model is required"
}
]
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "Image width must be between 300px and 6000px.",
"type": "invalid_request_error",
"code": "seedance_material_source_invalid",
"param": "asset_url"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}project_name isole les ressources au sein de l’organisation authentifiée. Sa valeur par défaut est default ; utilisez la même valeur, sensible à la casse, pour les groupes et ressources associés. Envoyez-la dans le corps JSON pour POST/PUT et dans les paramètres de requête pour GET/DELETE.
Exemple de requête
curl https://api.tokenlab.sh/v1/videos/assets/asset-20260720123456-qn7wr \
-X PUT \
-H "Authorization: Bearer $TOKENLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset_name":"Front view approved","metadata":{"approved_by":"creative-team"},"project_name":"default"}'
Exemple de réponse
{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"project_name": "default",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view approved",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": {"approved_by": "creative-team"},
"created_at": 1782998400000
}
Paramètres de chemin
ID de l'actif matériel TokenLab.
Corps
URL de remplacement de l'actif matériel accessible publiquement.
Nom d'affichage mis à jour stocké avec l'actif matériel.
1 - 128Image, Video, Audio 1 - 128Métadonnées client mises à jour stockées avec l'actif matériel.
Réponse
Actif matériel mis à jour
ID d'actif matériel TokenLab. Utilisez ceci comme material_asset_id une fois que l'actif devient ACTIVE.
seedance.material_asset aigc_avatar, liveness_face Image, Video, Audio PROCESSING, ACTIVE, FAILED, DELETED True lorsque l'actif est actif et non supprimé.
ID de groupe de matériel TokenLab qui possède cet actif matériel.
Portée du projet pour cet actif matériel.
Erreur de traitement terminale sûre pour le public. Les échecs de validation de source permanents incluent la contrainte de dimension rejetée.
Horodatage Unix de création de l'enregistrement de l'actif matériel.
Horodatage Unix de la dernière mise à jour de l'enregistrement de l'actif matériel.