Products
Create Upload URL
Get a presigned URL to upload a distributable file
POST
/
api
/
v1
/
products
/
delivery
/
upload-url
Create Upload URL
curl --request POST \
--url https://api.sequenzy.com/api/v1/products/delivery/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123
}
'import requests
url = "https://api.sequenzy.com/api/v1/products/delivery/upload-url"
payload = {
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123
}
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({filename: '<string>', contentType: '<string>', fileSizeBytes: 123})
};
fetch('https://api.sequenzy.com/api/v1/products/delivery/upload-url', 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.sequenzy.com/api/v1/products/delivery/upload-url",
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([
'filename' => '<string>',
'contentType' => '<string>',
'fileSizeBytes' => 123
]),
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.sequenzy.com/api/v1/products/delivery/upload-url"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123\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.sequenzy.com/api/v1/products/delivery/upload-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/products/delivery/upload-url")
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 \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"uploadUrl": "https://...r2.cloudflarestorage.com/...",
"publicUrl": "https://images.sequenzy.com/product-files/comp_123/9f2.../guide.pdf",
"fileName": "guide.pdf"
}
{
"success": false,
"error": "Unsupported file type. Use PDF, ePub, ZIP, image, audio, video, or text files."
}
{
"success": false,
"error": "Invalid or missing API key"
}
{
"success": false,
"error": "File uploads are not configured on this server. Attach an external URL instead."
}
Returns a presigned URL to upload a distributable file to Sequenzy storage. PUT the file bytes to
uploadUrl, then attach publicUrl to a product with Attach Delivery File.
Allowed types: PDF, ePub, ZIP, images, audio, video, and text files, up to 100MB. Files are stored under unguessable URLs.
Request
string
required
Original file name (used to build the hosted file name).
string
required
File MIME type, e.g.
application/pdf.number
required
File size in bytes (max 104857600).
curl -X POST "https://api.sequenzy.com/api/v1/products/delivery/upload-url" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename": "guide.pdf", "contentType": "application/pdf", "fileSizeBytes": 1048576}'
# Then upload the file bytes:
curl -X PUT "UPLOAD_URL_FROM_RESPONSE" \
-H "Content-Type: application/pdf" \
--data-binary @guide.pdf
Responses
{
"success": true,
"uploadUrl": "https://...r2.cloudflarestorage.com/...",
"publicUrl": "https://images.sequenzy.com/product-files/comp_123/9f2.../guide.pdf",
"fileName": "guide.pdf"
}
{
"success": false,
"error": "Unsupported file type. Use PDF, ePub, ZIP, image, audio, video, or text files."
}
{
"success": false,
"error": "Invalid or missing API key"
}
{
"success": false,
"error": "File uploads are not configured on this server. Attach an external URL instead."
}
⌘I
Create Upload URL
curl --request POST \
--url https://api.sequenzy.com/api/v1/products/delivery/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123
}
'import requests
url = "https://api.sequenzy.com/api/v1/products/delivery/upload-url"
payload = {
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123
}
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({filename: '<string>', contentType: '<string>', fileSizeBytes: 123})
};
fetch('https://api.sequenzy.com/api/v1/products/delivery/upload-url', 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.sequenzy.com/api/v1/products/delivery/upload-url",
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([
'filename' => '<string>',
'contentType' => '<string>',
'fileSizeBytes' => 123
]),
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.sequenzy.com/api/v1/products/delivery/upload-url"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123\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.sequenzy.com/api/v1/products/delivery/upload-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/products/delivery/upload-url")
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 \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"uploadUrl": "https://...r2.cloudflarestorage.com/...",
"publicUrl": "https://images.sequenzy.com/product-files/comp_123/9f2.../guide.pdf",
"fileName": "guide.pdf"
}
{
"success": false,
"error": "Unsupported file type. Use PDF, ePub, ZIP, image, audio, video, or text files."
}
{
"success": false,
"error": "Invalid or missing API key"
}
{
"success": false,
"error": "File uploads are not configured on this server. Attach an external URL instead."
}