Media
Complete Image Upload
Register an uploaded image in the shared media library
POST
/
api
/
v1
/
media
/
complete-upload
Complete Image Upload
curl --request POST \
--url https://api.sequenzy.com/api/v1/media/complete-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123,
"width": 123,
"height": 123,
"altText": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/media/complete-upload"
payload = {
"key": "<string>",
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123,
"width": 123,
"height": 123,
"altText": "<string>"
}
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({
key: '<string>',
filename: '<string>',
contentType: '<string>',
fileSizeBytes: 123,
width: 123,
height: 123,
altText: '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/media/complete-upload', 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/complete-upload",
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([
'key' => '<string>',
'filename' => '<string>',
'contentType' => '<string>',
'fileSizeBytes' => 123,
'width' => 123,
'height' => 123,
'altText' => '<string>'
]),
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/complete-upload"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123,\n \"width\": 123,\n \"height\": 123,\n \"altText\": \"<string>\"\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/complete-upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123,\n \"width\": 123,\n \"height\": 123,\n \"altText\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/media/complete-upload")
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 \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123,\n \"width\": 123,\n \"height\": 123,\n \"altText\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"asset": {
"id": "media_123",
"filename": "product-shot.png",
"url": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
"mimeType": "image/png",
"size": "248132",
"width": "1440",
"height": "900",
"altText": "HeyStream product results screen",
"companyId": "comp_123"
}
}
{
"success": false,
"error": "The uploaded image key is invalid for this company."
}
{
"success": false,
"error": "The uploaded image changed during verification. Start a new upload."
}
After uploading image bytes to the authenticated URL from Create Image Upload
URL, register the returned company-scoped
key. Completion is idempotent, so retrying the same key returns the existing
asset instead of creating a duplicate. The response contains the permanent
hosted URL to use as an image block’s src.
Request
Storage key returned by the upload-url endpoint. It must belong to the
authenticated company.
Hosted image file name.
Uploaded image MIME type: PNG, JPEG, GIF, or WebP.
Exact uploaded image size in bytes.
Optional intrinsic image width in pixels.
Optional intrinsic image height in pixels.
Accessible image description, or an empty string for a decorative image.
curl -X POST "https://api.sequenzy.com/api/v1/media/complete-upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"key":"email-images/comp_123/.../product-shot.png",
"filename":"product-shot.png",
"contentType":"image/png",
"fileSizeBytes":248132,
"width":1440,
"height":900,
"altText":"HeyStream product results screen"
}'
Responses
{
"success": true,
"asset": {
"id": "media_123",
"filename": "product-shot.png",
"url": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
"mimeType": "image/png",
"size": "248132",
"width": "1440",
"height": "900",
"altText": "HeyStream product results screen",
"companyId": "comp_123"
}
}
{
"success": false,
"error": "The uploaded image key is invalid for this company."
}
{
"success": false,
"error": "The uploaded image changed during verification. Start a new upload."
}
Previous
Get Account MetricsRetrieve aggregated email engagement metrics across all campaigns and sequences.
Next
⌘I
Complete Image Upload
curl --request POST \
--url https://api.sequenzy.com/api/v1/media/complete-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123,
"width": 123,
"height": 123,
"altText": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/media/complete-upload"
payload = {
"key": "<string>",
"filename": "<string>",
"contentType": "<string>",
"fileSizeBytes": 123,
"width": 123,
"height": 123,
"altText": "<string>"
}
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({
key: '<string>',
filename: '<string>',
contentType: '<string>',
fileSizeBytes: 123,
width: 123,
height: 123,
altText: '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/media/complete-upload', 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/complete-upload",
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([
'key' => '<string>',
'filename' => '<string>',
'contentType' => '<string>',
'fileSizeBytes' => 123,
'width' => 123,
'height' => 123,
'altText' => '<string>'
]),
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/complete-upload"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123,\n \"width\": 123,\n \"height\": 123,\n \"altText\": \"<string>\"\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/complete-upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123,\n \"width\": 123,\n \"height\": 123,\n \"altText\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/media/complete-upload")
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 \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"fileSizeBytes\": 123,\n \"width\": 123,\n \"height\": 123,\n \"altText\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"asset": {
"id": "media_123",
"filename": "product-shot.png",
"url": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
"mimeType": "image/png",
"size": "248132",
"width": "1440",
"height": "900",
"altText": "HeyStream product results screen",
"companyId": "comp_123"
}
}
{
"success": false,
"error": "The uploaded image key is invalid for this company."
}
{
"success": false,
"error": "The uploaded image changed during verification. Start a new upload."
}