Media
Create Image Upload URL
Get a presigned URL for a block-ready email image
POST
/
api
/
v1
/
media
/
upload-url
Create Image Upload URL
curl --request POST \
--url https://api.sequenzy.com/api/v1/media/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/media/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/media/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/media/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/media/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/media/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/media/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://api.sequenzy.com/api/v1/media/upload-bytes?...",
"publicUrl": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
"key": "email-images/comp_123/.../product-shot.png",
"fileName": "product-shot.png"
}
{
"success": false,
"error": "Unsupported image type. Use PNG, JPEG, GIF, or WebP."
}
{
"success": false,
"error": "Image uploads are not configured on this server."
}
Returns a company-scoped authenticated API URL for uploading an image to
Sequenzy’s shared media library. PUT the exact bytes to
uploadUrl with the
same API credentials, then call Complete Image
Upload with the returned key.
PNG, JPEG, GIF, and WebP images up to 5MB are accepted. These formats can be
used immediately in email image blocks without an asynchronous conversion.
Request
Original file name, including a supported image extension.
Image MIME type, such as
image/png.Exact image size in bytes, from 1 through 5242880.
curl -X POST "https://api.sequenzy.com/api/v1/media/upload-url" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename":"product-shot.png","contentType":"image/png","fileSizeBytes":248132}'
curl -X PUT "UPLOAD_URL_FROM_RESPONSE" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: image/png" \
--data-binary @product-shot.png
Responses
{
"success": true,
"uploadUrl": "https://api.sequenzy.com/api/v1/media/upload-bytes?...",
"publicUrl": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
"key": "email-images/comp_123/.../product-shot.png",
"fileName": "product-shot.png"
}
{
"success": false,
"error": "Unsupported image type. Use PNG, JPEG, GIF, or WebP."
}
{
"success": false,
"error": "Image uploads are not configured on this server."
}
⌘I
Create Image Upload URL
curl --request POST \
--url https://api.sequenzy.com/api/v1/media/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/media/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/media/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/media/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/media/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/media/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/media/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://api.sequenzy.com/api/v1/media/upload-bytes?...",
"publicUrl": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
"key": "email-images/comp_123/.../product-shot.png",
"fileName": "product-shot.png"
}
{
"success": false,
"error": "Unsupported image type. Use PNG, JPEG, GIF, or WebP."
}
{
"success": false,
"error": "Image uploads are not configured on this server."
}