Upload bytes for one reserved studio asset
Requires studio_assets:write and an upload_required reconciliation entry. Content-Type and Content-Length must exactly match the reservation and the streamed bytes must match its SHA-256. The API marks the asset uploading through Convex, uses only the server-derived R2 object key, computes MD5/SHA-256 while streaming to R2, then marks uploaded and finalizes. It never fetches, crops, renders, or accepts caller-selected storage paths.
curl --request PUT \
--url https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: <content-type>' \
--data '<string>'import requests
url = "https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}"
payload = "<string>"
headers = {
"Content-Type": "<content-type>",
"Content-Length": "<content-length>",
"Authorization": "Bearer <token>"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Content-Type': '<content-type>',
'Content-Length': '<content-length>',
Authorization: 'Bearer <token>'
},
body: '<string>'
};
fetch('https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}', 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.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Length: <content-length>",
"Content-Type: <content-type>"
],
]);
$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.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Authorization", "Bearer <token>")
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.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}")
.header("Content-Type", "<content-type>")
.header("Content-Length", "<content-length>")
.header("Authorization", "Bearer <token>")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = '<content-type>'
request["Content-Length"] = '<content-length>'
request["Authorization"] = 'Bearer <token>'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"byte_size": 2,
"content_type": "image/jpeg",
"id": "<string>",
"original_filename": "<string>",
"status": "reserved",
"upload_session_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}Authorizations
Batch Relay scoped API key or an anonymous Test Mode session. Scope names document required capabilities. Anonymous sessions are sandbox-only and do not authorize studio, event, billing, or Live Mode operations.
Headers
image/jpeg, image/png, image/tiff, image/webp 1 <= x <= 99614720Untrusted optional analytics hint naming the calling client surface. It never affects authorization, routing, pricing, or behavior.
1 - 100Untrusted optional analytics hint naming the calling client version. It never affects authorization, routing, pricing, or behavior.
1 - 100Untrusted optional analytics hint naming the invocation mode. It never affects authorization, routing, pricing, or behavior.
1 - 100Path Parameters
11Body
The body is of type file.
Response
Finalized asset lifecycle projection
x >= 1image/jpeg, image/png, image/tiff, image/webp Opaque session-bound image asset ID; it is not a credential.
reserved, uploading, uploaded, ready, failed, deleted, cleanup_leased curl --request PUT \
--url https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: <content-type>' \
--data '<string>'import requests
url = "https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}"
payload = "<string>"
headers = {
"Content-Type": "<content-type>",
"Content-Length": "<content-length>",
"Authorization": "Bearer <token>"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Content-Type': '<content-type>',
'Content-Length': '<content-length>',
Authorization: 'Bearer <token>'
},
body: '<string>'
};
fetch('https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}', 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.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Length: <content-length>",
"Content-Type: <content-type>"
],
]);
$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.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Authorization", "Bearer <token>")
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.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}")
.header("Content-Type", "<content-type>")
.header("Content-Length", "<content-length>")
.header("Authorization", "Bearer <token>")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.batchrelay.com/v1/studio-assets/sessions/{session_id}/assets/{asset_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = '<content-type>'
request["Content-Length"] = '<content-length>'
request["Authorization"] = 'Bearer <token>'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"byte_size": 2,
"content_type": "image/jpeg",
"id": "<string>",
"original_filename": "<string>",
"status": "reserved",
"upload_session_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"docs_url": "<string>",
"error": "<string>",
"message": "<string>",
"request_id": "<string>"
}