Generate Pre-signed URL
curl --request GET \
--url https://api.pdf.co/v1/file/upload/get-presigned-url \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pdf.co/v1/file/upload/get-presigned-url"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pdf.co/v1/file/upload/get-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.pdf.co/v1/file/upload/get-presigned-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.pdf.co/v1/file/upload/get-presigned-url"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pdf.co/v1/file/upload/get-presigned-url")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pdf.co/v1/file/upload/get-presigned-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"presignedUrl": "https://pdf-temp-files.s3.us-west-2.amazonaws.com/example/sample.pdf",
"url": "https://pdf-temp-files.s3.us-west-2.amazonaws.com/example/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf"
}{
"error": true,
"status": 400,
"message": "Bad request. Typically due to bad input parameters or unreachable input URLs (e.g., access restrictions like login or password)."
}{
"error": true,
"status": 401,
"message": "Unauthorized. Authentication is required and has failed or has not yet been provided."
}{
"error": true,
"status": 402,
"message": "Not enough credits."
}{
"error": true,
"status": 403,
"message": "Access forbidden for input URL."
}{
"error": true,
"status": 404,
"message": "The requested resource could not be found."
}{
"error": true,
"status": 408,
"message": "The server timed out waiting for the request."
}{
"error": true,
"status": 429,
"message": "Too many requests in a given time period."
}{
"error": true,
"status": 441,
"message": "Invalid Password. Password protected document."
}{
"error": true,
"status": 442,
"message": "Input document is damaged or of incorrect type."
}{
"error": true,
"status": 443,
"message": "Permissions. The operation is prohibited by document security settings."
}{
"error": true,
"status": 444,
"message": "Profiles parsing error. Please ensure that the configuration is supported."
}{
"error": true,
"status": 445,
"message": "Timeout error. For large documents, use asynchronous mode (async=true) and check status via /job/check."
}{
"error": true,
"status": 446,
"message": "Some files required for conversion are missing."
}{
"error": true,
"status": 447,
"message": "Invalid template."
}{
"error": true,
"status": 448,
"message": "Invalid URL or HTML. Ensure the provided URL is valid and accessible."
}{
"error": true,
"status": 449,
"message": "Invalid index range. Page index is out of range."
}{
"error": true,
"status": 450,
"message": "Invalid page range specified."
}{
"error": true,
"status": 452,
"message": "Invalid URL."
}{
"error": true,
"status": 454,
"message": "Invalid parameters."
}{
"error": true,
"status": 500,
"message": "Something went wrong. Please try again or contact support."
}Document, File & System
Generate Pre-signed URL (API Tester)
Run Generate Pre-signed URL live from your browser — send a real request and see the response and credit usage, no code required. PDF.co API Tester.
GET
/
v1
/
file
/
upload
/
get-presigned-url
Generate Pre-signed URL
curl --request GET \
--url https://api.pdf.co/v1/file/upload/get-presigned-url \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pdf.co/v1/file/upload/get-presigned-url"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pdf.co/v1/file/upload/get-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.pdf.co/v1/file/upload/get-presigned-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.pdf.co/v1/file/upload/get-presigned-url"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pdf.co/v1/file/upload/get-presigned-url")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pdf.co/v1/file/upload/get-presigned-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"presignedUrl": "https://pdf-temp-files.s3.us-west-2.amazonaws.com/example/sample.pdf",
"url": "https://pdf-temp-files.s3.us-west-2.amazonaws.com/example/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf"
}{
"error": true,
"status": 400,
"message": "Bad request. Typically due to bad input parameters or unreachable input URLs (e.g., access restrictions like login or password)."
}{
"error": true,
"status": 401,
"message": "Unauthorized. Authentication is required and has failed or has not yet been provided."
}{
"error": true,
"status": 402,
"message": "Not enough credits."
}{
"error": true,
"status": 403,
"message": "Access forbidden for input URL."
}{
"error": true,
"status": 404,
"message": "The requested resource could not be found."
}{
"error": true,
"status": 408,
"message": "The server timed out waiting for the request."
}{
"error": true,
"status": 429,
"message": "Too many requests in a given time period."
}{
"error": true,
"status": 441,
"message": "Invalid Password. Password protected document."
}{
"error": true,
"status": 442,
"message": "Input document is damaged or of incorrect type."
}{
"error": true,
"status": 443,
"message": "Permissions. The operation is prohibited by document security settings."
}{
"error": true,
"status": 444,
"message": "Profiles parsing error. Please ensure that the configuration is supported."
}{
"error": true,
"status": 445,
"message": "Timeout error. For large documents, use asynchronous mode (async=true) and check status via /job/check."
}{
"error": true,
"status": 446,
"message": "Some files required for conversion are missing."
}{
"error": true,
"status": 447,
"message": "Invalid template."
}{
"error": true,
"status": 448,
"message": "Invalid URL or HTML. Ensure the provided URL is valid and accessible."
}{
"error": true,
"status": 449,
"message": "Invalid index range. Page index is out of range."
}{
"error": true,
"status": 450,
"message": "Invalid page range specified."
}{
"error": true,
"status": 452,
"message": "Invalid URL."
}{
"error": true,
"status": 454,
"message": "Invalid parameters."
}{
"error": true,
"status": 500,
"message": "Something went wrong. Please try again or contact support."
}Save both links from GET before uploading: use
presignedUrl as the destination for the PUT request. Keep the separate url to open, download, or process the uploaded file after PUT succeeds. PUT normally returns only HTTP 200 with an empty body; it does not return another file URL.Full reference: Generate Pre-signed URL.
Upload in two requests
- Generate links with this GET request. For the PUT Tester, use
contenttype=application/octet-streamand enter your file name. GET does not upload any file bytes. - Copy the complete
presignedUrl, including its query string. Open Upload File via Pre-signed URL (PUT), paste it into the single URL field, select your local file, and send the request. Keep the returned accessurlfor later.
Content-Type: application/octet-stream and no PDF.co API key. A successful storage PUT normally returns HTTP 200 with an empty body. Then use the original access url in another PDF.co API request. The two requests do not advance or share response values automatically.
Postman and cURL can also send the PUT to the complete signed URL. See the upload reference.Query Parameters
Response
Upload and access URLs generated. The file is available only after a successful PUT. Example URLs omit signing credentials; use the complete URLs from your actual response.
Was this page helpful?