Generate Upload Presigned Url
curl --request POST \
--url https://api.upwell.com/api/rest/generate-upload-presigned-url \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"associationType": "SHIPMENT",
"associationId": "shi_01HZX4K7LOAD",
"documentType": "PROOF_OF_DELIVERY",
"fileName": "pod.pdf",
"mimeType": "application/pdf",
"sourceSystem": "YOUR_TMS",
"sourceSystemId": "pod-100245"
}
}
'import requests
url = "https://api.upwell.com/api/rest/generate-upload-presigned-url"
payload = { "input": {
"associationType": "SHIPMENT",
"associationId": "shi_01HZX4K7LOAD",
"documentType": "PROOF_OF_DELIVERY",
"fileName": "pod.pdf",
"mimeType": "application/pdf",
"sourceSystem": "YOUR_TMS",
"sourceSystemId": "pod-100245"
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
associationType: 'SHIPMENT',
associationId: 'shi_01HZX4K7LOAD',
documentType: 'PROOF_OF_DELIVERY',
fileName: 'pod.pdf',
mimeType: 'application/pdf',
sourceSystem: 'YOUR_TMS',
sourceSystemId: 'pod-100245'
}
})
};
fetch('https://api.upwell.com/api/rest/generate-upload-presigned-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.upwell.com/api/rest/generate-upload-presigned-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([
'input' => [
'associationType' => 'SHIPMENT',
'associationId' => 'shi_01HZX4K7LOAD',
'documentType' => 'PROOF_OF_DELIVERY',
'fileName' => 'pod.pdf',
'mimeType' => 'application/pdf',
'sourceSystem' => 'YOUR_TMS',
'sourceSystemId' => 'pod-100245'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.upwell.com/api/rest/generate-upload-presigned-url"
payload := strings.NewReader("{\n \"input\": {\n \"associationType\": \"SHIPMENT\",\n \"associationId\": \"shi_01HZX4K7LOAD\",\n \"documentType\": \"PROOF_OF_DELIVERY\",\n \"fileName\": \"pod.pdf\",\n \"mimeType\": \"application/pdf\",\n \"sourceSystem\": \"YOUR_TMS\",\n \"sourceSystemId\": \"pod-100245\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.upwell.com/api/rest/generate-upload-presigned-url")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"associationType\": \"SHIPMENT\",\n \"associationId\": \"shi_01HZX4K7LOAD\",\n \"documentType\": \"PROOF_OF_DELIVERY\",\n \"fileName\": \"pod.pdf\",\n \"mimeType\": \"application/pdf\",\n \"sourceSystem\": \"YOUR_TMS\",\n \"sourceSystemId\": \"pod-100245\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/generate-upload-presigned-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"associationType\": \"SHIPMENT\",\n \"associationId\": \"shi_01HZX4K7LOAD\",\n \"documentType\": \"PROOF_OF_DELIVERY\",\n \"fileName\": \"pod.pdf\",\n \"mimeType\": \"application/pdf\",\n \"sourceSystem\": \"YOUR_TMS\",\n \"sourceSystemId\": \"pod-100245\"\n }\n}"
response = http.request(request)
puts response.read_body{
"generateUploadPresignedUrl": {
"uploadUrl": "https://example.invalid/upload/file_01HZX4K7POD?X-Amz-Signature=example",
"documentId": "doc_01HZX4K7POD"
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Documents
Generate Upload Presigned Url
Generate a presigned URL for direct S3 file upload.
Integration notes:
- If you provide
sourceSystemyou must also providesourceSystemId(and vice versa) — thedocuments_source_system_pair_nullity_chkconstraint requires both or neither. - On the subsequent
PUTto the returneduploadUrl, prefer anArrayBufferbody overBlob. Wrapping in aBlobwith an explicit type can cause some Node fetch implementations to add headers that aren’t inX-Amz-SignedHeaders, breaking the SigV4 signature.
See Integration patterns.
POST
/
api
/
rest
/
generate-upload-presigned-url
Generate Upload Presigned Url
curl --request POST \
--url https://api.upwell.com/api/rest/generate-upload-presigned-url \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"associationType": "SHIPMENT",
"associationId": "shi_01HZX4K7LOAD",
"documentType": "PROOF_OF_DELIVERY",
"fileName": "pod.pdf",
"mimeType": "application/pdf",
"sourceSystem": "YOUR_TMS",
"sourceSystemId": "pod-100245"
}
}
'import requests
url = "https://api.upwell.com/api/rest/generate-upload-presigned-url"
payload = { "input": {
"associationType": "SHIPMENT",
"associationId": "shi_01HZX4K7LOAD",
"documentType": "PROOF_OF_DELIVERY",
"fileName": "pod.pdf",
"mimeType": "application/pdf",
"sourceSystem": "YOUR_TMS",
"sourceSystemId": "pod-100245"
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
associationType: 'SHIPMENT',
associationId: 'shi_01HZX4K7LOAD',
documentType: 'PROOF_OF_DELIVERY',
fileName: 'pod.pdf',
mimeType: 'application/pdf',
sourceSystem: 'YOUR_TMS',
sourceSystemId: 'pod-100245'
}
})
};
fetch('https://api.upwell.com/api/rest/generate-upload-presigned-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.upwell.com/api/rest/generate-upload-presigned-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([
'input' => [
'associationType' => 'SHIPMENT',
'associationId' => 'shi_01HZX4K7LOAD',
'documentType' => 'PROOF_OF_DELIVERY',
'fileName' => 'pod.pdf',
'mimeType' => 'application/pdf',
'sourceSystem' => 'YOUR_TMS',
'sourceSystemId' => 'pod-100245'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.upwell.com/api/rest/generate-upload-presigned-url"
payload := strings.NewReader("{\n \"input\": {\n \"associationType\": \"SHIPMENT\",\n \"associationId\": \"shi_01HZX4K7LOAD\",\n \"documentType\": \"PROOF_OF_DELIVERY\",\n \"fileName\": \"pod.pdf\",\n \"mimeType\": \"application/pdf\",\n \"sourceSystem\": \"YOUR_TMS\",\n \"sourceSystemId\": \"pod-100245\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.upwell.com/api/rest/generate-upload-presigned-url")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"associationType\": \"SHIPMENT\",\n \"associationId\": \"shi_01HZX4K7LOAD\",\n \"documentType\": \"PROOF_OF_DELIVERY\",\n \"fileName\": \"pod.pdf\",\n \"mimeType\": \"application/pdf\",\n \"sourceSystem\": \"YOUR_TMS\",\n \"sourceSystemId\": \"pod-100245\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/generate-upload-presigned-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"associationType\": \"SHIPMENT\",\n \"associationId\": \"shi_01HZX4K7LOAD\",\n \"documentType\": \"PROOF_OF_DELIVERY\",\n \"fileName\": \"pod.pdf\",\n \"mimeType\": \"application/pdf\",\n \"sourceSystem\": \"YOUR_TMS\",\n \"sourceSystemId\": \"pod-100245\"\n }\n}"
response = http.request(request)
puts response.read_body{
"generateUploadPresignedUrl": {
"uploadUrl": "https://example.invalid/upload/file_01HZX4K7POD?X-Amz-Signature=example",
"documentId": "doc_01HZX4K7POD"
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Step 1 of the two-step upload — and the only path that runs AI classification for carrier-invoice documents. Re-presigning an already-uploaded
(sourceSystem, sourceSystemId) fails with 400 DOCUMENT_ALREADY_UPLOADED. See Document conventions.Authorizations
Body
application/json
Query parameters can also be provided in the request body as a JSON object

