Generate a presigned S3 URL for a customer file upload
curl --request POST \
--url https://api.opencals.com/storefront/uploads/presign \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"questionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "logo.png",
"mime": "image/png",
"size": 20480
}
'import requests
url = "https://api.opencals.com/storefront/uploads/presign"
payload = {
"questionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "logo.png",
"mime": "image/png",
"size": 20480
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
questionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
filename: 'logo.png',
mime: 'image/png',
size: 20480
})
};
fetch('https://api.opencals.com/storefront/uploads/presign', 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.opencals.com/storefront/uploads/presign",
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([
'questionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'filename' => 'logo.png',
'mime' => 'image/png',
'size' => 20480
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.opencals.com/storefront/uploads/presign"
payload := strings.NewReader("{\n \"questionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filename\": \"logo.png\",\n \"mime\": \"image/png\",\n \"size\": 20480\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.opencals.com/storefront/uploads/presign")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"questionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filename\": \"logo.png\",\n \"mime\": \"image/png\",\n \"size\": 20480\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opencals.com/storefront/uploads/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"questionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filename\": \"logo.png\",\n \"mime\": \"image/png\",\n \"size\": 20480\n}"
response = http.request(request)
puts response.read_body{
"fileId": "<string>",
"presignedUrl": "<string>",
"expiresIn": 3600
}Customer Uploads
Generate a presigned S3 URL for a customer file upload
POST
/
storefront
/
uploads
/
presign
Generate a presigned S3 URL for a customer file upload
curl --request POST \
--url https://api.opencals.com/storefront/uploads/presign \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"questionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "logo.png",
"mime": "image/png",
"size": 20480
}
'import requests
url = "https://api.opencals.com/storefront/uploads/presign"
payload = {
"questionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "logo.png",
"mime": "image/png",
"size": 20480
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
questionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
filename: 'logo.png',
mime: 'image/png',
size: 20480
})
};
fetch('https://api.opencals.com/storefront/uploads/presign', 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.opencals.com/storefront/uploads/presign",
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([
'questionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'filename' => 'logo.png',
'mime' => 'image/png',
'size' => 20480
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.opencals.com/storefront/uploads/presign"
payload := strings.NewReader("{\n \"questionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filename\": \"logo.png\",\n \"mime\": \"image/png\",\n \"size\": 20480\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.opencals.com/storefront/uploads/presign")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"questionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filename\": \"logo.png\",\n \"mime\": \"image/png\",\n \"size\": 20480\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opencals.com/storefront/uploads/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"questionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filename\": \"logo.png\",\n \"mime\": \"image/png\",\n \"size\": 20480\n}"
response = http.request(request)
puts response.read_body{
"fileId": "<string>",
"presignedUrl": "<string>",
"expiresIn": 3600
}Authorizations
Storefront API key (sfk_...)
Body
application/json
ID of the file-upload question the file answers
Whether the question is a checkout or feedback question
Available options:
checkout, feedback Original filename
Example:
"logo.png"
MIME type of the file
Example:
"image/png"
Size of the file in bytes
Example:
20480
Response
200 - application/json
Presigned upload URL + file id
Last modified on July 26, 2026
Was this page helpful?
⌘I