Create assets or replace their files, and get links to upload them to
curl --request PUT \
--url https://api.occtoo.com/v1/assets/{dataSourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assets": [
{
"entryKey": "sku-1",
"filename": "front-v2.jpg",
"properties": [
{
"id": "width",
"value": 1280
},
{
"id": "title",
"language": "sv",
"value": null
}
]
},
{
"entryKey": "sku-3",
"filename": "side.jpg"
}
]
}
'import requests
url = "https://api.occtoo.com/v1/assets/{dataSourceId}"
payload = { "assets": [
{
"entryKey": "sku-1",
"filename": "front-v2.jpg",
"properties": [
{
"id": "width",
"value": 1280
},
{
"id": "title",
"language": "sv",
"value": None
}
]
},
{
"entryKey": "sku-3",
"filename": "side.jpg"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assets: [
{
entryKey: 'sku-1',
filename: 'front-v2.jpg',
properties: [{id: 'width', value: 1280}, {id: 'title', language: 'sv', value: null}]
},
{entryKey: 'sku-3', filename: 'side.jpg'}
]
})
};
fetch('https://api.occtoo.com/v1/assets/{dataSourceId}', 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.occtoo.com/v1/assets/{dataSourceId}",
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([
'assets' => [
[
'entryKey' => 'sku-1',
'filename' => 'front-v2.jpg',
'properties' => [
[
'id' => 'width',
'value' => 1280
],
[
'id' => 'title',
'language' => 'sv',
'value' => null
]
]
],
[
'entryKey' => 'sku-3',
'filename' => 'side.jpg'
]
]
]),
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.occtoo.com/v1/assets/{dataSourceId}"
payload := strings.NewReader("{\n \"assets\": [\n {\n \"entryKey\": \"sku-1\",\n \"filename\": \"front-v2.jpg\",\n \"properties\": [\n {\n \"id\": \"width\",\n \"value\": 1280\n },\n {\n \"id\": \"title\",\n \"language\": \"sv\",\n \"value\": null\n }\n ]\n },\n {\n \"entryKey\": \"sku-3\",\n \"filename\": \"side.jpg\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.occtoo.com/v1/assets/{dataSourceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assets\": [\n {\n \"entryKey\": \"sku-1\",\n \"filename\": \"front-v2.jpg\",\n \"properties\": [\n {\n \"id\": \"width\",\n \"value\": 1280\n },\n {\n \"id\": \"title\",\n \"language\": \"sv\",\n \"value\": null\n }\n ]\n },\n {\n \"entryKey\": \"sku-3\",\n \"filename\": \"side.jpg\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/assets/{dataSourceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assets\": [\n {\n \"entryKey\": \"sku-1\",\n \"filename\": \"front-v2.jpg\",\n \"properties\": [\n {\n \"id\": \"width\",\n \"value\": 1280\n },\n {\n \"id\": \"title\",\n \"language\": \"sv\",\n \"value\": null\n }\n ]\n },\n {\n \"entryKey\": \"sku-3\",\n \"filename\": \"side.jpg\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"initialized": {
"sku-1": {
"uploadUrl": "https://occtoomedia.blob.core.windows.net/6b1f0b3c/9c2a7d18/front.jpg?sv=2024-11-04&se=...&sig=...",
"expiresAt": "2026-09-25T13:30:00+00:00"
},
"sku-2": {
"uploadUrl": "https://occtoomedia.blob.core.windows.net/6b1f0b3c/1e77a904/back.jpg?sv=2024-11-04&se=...&sig=...",
"expiresAt": "2026-09-25T13:30:00+00:00"
}
},
"failed": {}
}Assets API
Create assets or replace their files, and get links to upload them to
Creates assets or replaces the files behind them, and returns one signed upload link per entry key. At most 25 assets per call. The request is the same as initialize’s; sending it twice ends in the same state.
| Entry key | What happens |
|---|---|
| No asset yet | Created the same way initialize creates it, in folderId or the data source’s root folder. |
| Asset with a file | The file is deleted before the call returns. The entry goes back to Initialized, file details cleared, folder and other properties kept. |
| Asset still waiting for its upload | Nothing to delete. Entry reset the same way. |
properties follow initialize’s rules: on an existing asset, a sent property is set, null clears it (for a localized property, that row’s language), and an omitted property keeps its value.
Everything is checked before any file is deleted: properties, data source, and folderId, validated even when no key gets created. One bad asset fails the whole call. PUT the new bytes to each link and call /complete, as after initializing.
PUT
/
v1
/
assets
/
{dataSourceId}
Create assets or replace their files, and get links to upload them to
curl --request PUT \
--url https://api.occtoo.com/v1/assets/{dataSourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assets": [
{
"entryKey": "sku-1",
"filename": "front-v2.jpg",
"properties": [
{
"id": "width",
"value": 1280
},
{
"id": "title",
"language": "sv",
"value": null
}
]
},
{
"entryKey": "sku-3",
"filename": "side.jpg"
}
]
}
'import requests
url = "https://api.occtoo.com/v1/assets/{dataSourceId}"
payload = { "assets": [
{
"entryKey": "sku-1",
"filename": "front-v2.jpg",
"properties": [
{
"id": "width",
"value": 1280
},
{
"id": "title",
"language": "sv",
"value": None
}
]
},
{
"entryKey": "sku-3",
"filename": "side.jpg"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assets: [
{
entryKey: 'sku-1',
filename: 'front-v2.jpg',
properties: [{id: 'width', value: 1280}, {id: 'title', language: 'sv', value: null}]
},
{entryKey: 'sku-3', filename: 'side.jpg'}
]
})
};
fetch('https://api.occtoo.com/v1/assets/{dataSourceId}', 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.occtoo.com/v1/assets/{dataSourceId}",
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([
'assets' => [
[
'entryKey' => 'sku-1',
'filename' => 'front-v2.jpg',
'properties' => [
[
'id' => 'width',
'value' => 1280
],
[
'id' => 'title',
'language' => 'sv',
'value' => null
]
]
],
[
'entryKey' => 'sku-3',
'filename' => 'side.jpg'
]
]
]),
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.occtoo.com/v1/assets/{dataSourceId}"
payload := strings.NewReader("{\n \"assets\": [\n {\n \"entryKey\": \"sku-1\",\n \"filename\": \"front-v2.jpg\",\n \"properties\": [\n {\n \"id\": \"width\",\n \"value\": 1280\n },\n {\n \"id\": \"title\",\n \"language\": \"sv\",\n \"value\": null\n }\n ]\n },\n {\n \"entryKey\": \"sku-3\",\n \"filename\": \"side.jpg\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.occtoo.com/v1/assets/{dataSourceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assets\": [\n {\n \"entryKey\": \"sku-1\",\n \"filename\": \"front-v2.jpg\",\n \"properties\": [\n {\n \"id\": \"width\",\n \"value\": 1280\n },\n {\n \"id\": \"title\",\n \"language\": \"sv\",\n \"value\": null\n }\n ]\n },\n {\n \"entryKey\": \"sku-3\",\n \"filename\": \"side.jpg\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/assets/{dataSourceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assets\": [\n {\n \"entryKey\": \"sku-1\",\n \"filename\": \"front-v2.jpg\",\n \"properties\": [\n {\n \"id\": \"width\",\n \"value\": 1280\n },\n {\n \"id\": \"title\",\n \"language\": \"sv\",\n \"value\": null\n }\n ]\n },\n {\n \"entryKey\": \"sku-3\",\n \"filename\": \"side.jpg\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"initialized": {
"sku-1": {
"uploadUrl": "https://occtoomedia.blob.core.windows.net/6b1f0b3c/9c2a7d18/front.jpg?sv=2024-11-04&se=...&sig=...",
"expiresAt": "2026-09-25T13:30:00+00:00"
},
"sku-2": {
"uploadUrl": "https://occtoomedia.blob.core.windows.net/6b1f0b3c/1e77a904/back.jpg?sv=2024-11-04&se=...&sig=...",
"expiresAt": "2026-09-25T13:30:00+00:00"
}
},
"failed": {}
}Authorizations
kindeOAuthbearerAuthapiKey
Path Parameters
Was this page helpful?