curl --request POST \
--url 'https://api.bannerify.co/v1/templates/createStoredPdf?apiKey=' \
--header 'Content-Type: application/json' \
--data '
{
"apiKey": "YOUR_API_KEY",
"templateId": "tpl_xxx",
"modifications": [
{
"name": "headline",
"text": "Summer sale"
},
{
"name": "photo",
"src": "https://example.com/photo.png"
}
]
}
'import requests
url = "https://api.bannerify.co/v1/templates/createStoredPdf?apiKey="
payload = {
"apiKey": "YOUR_API_KEY",
"templateId": "tpl_xxx",
"modifications": [
{
"name": "headline",
"text": "Summer sale"
},
{
"name": "photo",
"src": "https://example.com/photo.png"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
apiKey: 'YOUR_API_KEY',
templateId: 'tpl_xxx',
modifications: [
{name: 'headline', text: 'Summer sale'},
{name: 'photo', src: 'https://example.com/photo.png'}
]
})
};
fetch('https://api.bannerify.co/v1/templates/createStoredPdf?apiKey=', 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.bannerify.co/v1/templates/createStoredPdf?apiKey=",
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([
'apiKey' => 'YOUR_API_KEY',
'templateId' => 'tpl_xxx',
'modifications' => [
[
'name' => 'headline',
'text' => 'Summer sale'
],
[
'name' => 'photo',
'src' => 'https://example.com/photo.png'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.bannerify.co/v1/templates/createStoredPdf?apiKey="
payload := strings.NewReader("{\n \"apiKey\": \"YOUR_API_KEY\",\n \"templateId\": \"tpl_xxx\",\n \"modifications\": [\n {\n \"name\": \"headline\",\n \"text\": \"Summer sale\"\n },\n {\n \"name\": \"photo\",\n \"src\": \"https://example.com/photo.png\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.bannerify.co/v1/templates/createStoredPdf?apiKey=")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"YOUR_API_KEY\",\n \"templateId\": \"tpl_xxx\",\n \"modifications\": [\n {\n \"name\": \"headline\",\n \"text\": \"Summer sale\"\n },\n {\n \"name\": \"photo\",\n \"src\": \"https://example.com/photo.png\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bannerify.co/v1/templates/createStoredPdf?apiKey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"YOUR_API_KEY\",\n \"templateId\": \"tpl_xxx\",\n \"modifications\": [\n {\n \"name\": \"headline\",\n \"text\": \"Summer sale\"\n },\n {\n \"name\": \"photo\",\n \"src\": \"https://example.com/photo.png\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"url": "https://images.bannerify.co/files/0b3c1c1e-5d6f-4c52-9e0a-8f6a4c0f2a11.pdf"
}{
"error": {
"code": "BAD_REQUEST",
"docs": "https://bannerify.co/docs/api-reference/errors/code/BAD_REQUEST",
"message": "<string>",
"requestId": "req:1234"
}
}{
"error": {
"code": "FORBIDDEN",
"docs": "https://bannerify.co/docs/api-reference/errors/code/FORBIDDEN",
"message": "<string>",
"requestId": "req:1234"
}
}{
"error": {
"code": "NOT_FOUND",
"docs": "https://bannerify.co/docs/api-reference/errors/code/NOT_FOUND",
"message": "<string>",
"requestId": "req:1234"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"docs": "https://bannerify.co/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR",
"message": "<string>",
"requestId": "req:1234"
}
}Create a stored PDF
The createStoredPdf endpoint renders a template as a PDF and returns a public URL, or saves the file to your own S3-compatible bucket.
curl --request POST \
--url 'https://api.bannerify.co/v1/templates/createStoredPdf?apiKey=' \
--header 'Content-Type: application/json' \
--data '
{
"apiKey": "YOUR_API_KEY",
"templateId": "tpl_xxx",
"modifications": [
{
"name": "headline",
"text": "Summer sale"
},
{
"name": "photo",
"src": "https://example.com/photo.png"
}
]
}
'import requests
url = "https://api.bannerify.co/v1/templates/createStoredPdf?apiKey="
payload = {
"apiKey": "YOUR_API_KEY",
"templateId": "tpl_xxx",
"modifications": [
{
"name": "headline",
"text": "Summer sale"
},
{
"name": "photo",
"src": "https://example.com/photo.png"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
apiKey: 'YOUR_API_KEY',
templateId: 'tpl_xxx',
modifications: [
{name: 'headline', text: 'Summer sale'},
{name: 'photo', src: 'https://example.com/photo.png'}
]
})
};
fetch('https://api.bannerify.co/v1/templates/createStoredPdf?apiKey=', 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.bannerify.co/v1/templates/createStoredPdf?apiKey=",
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([
'apiKey' => 'YOUR_API_KEY',
'templateId' => 'tpl_xxx',
'modifications' => [
[
'name' => 'headline',
'text' => 'Summer sale'
],
[
'name' => 'photo',
'src' => 'https://example.com/photo.png'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.bannerify.co/v1/templates/createStoredPdf?apiKey="
payload := strings.NewReader("{\n \"apiKey\": \"YOUR_API_KEY\",\n \"templateId\": \"tpl_xxx\",\n \"modifications\": [\n {\n \"name\": \"headline\",\n \"text\": \"Summer sale\"\n },\n {\n \"name\": \"photo\",\n \"src\": \"https://example.com/photo.png\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.bannerify.co/v1/templates/createStoredPdf?apiKey=")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"YOUR_API_KEY\",\n \"templateId\": \"tpl_xxx\",\n \"modifications\": [\n {\n \"name\": \"headline\",\n \"text\": \"Summer sale\"\n },\n {\n \"name\": \"photo\",\n \"src\": \"https://example.com/photo.png\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bannerify.co/v1/templates/createStoredPdf?apiKey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"YOUR_API_KEY\",\n \"templateId\": \"tpl_xxx\",\n \"modifications\": [\n {\n \"name\": \"headline\",\n \"text\": \"Summer sale\"\n },\n {\n \"name\": \"photo\",\n \"src\": \"https://example.com/photo.png\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"url": "https://images.bannerify.co/files/0b3c1c1e-5d6f-4c52-9e0a-8f6a4c0f2a11.pdf"
}{
"error": {
"code": "BAD_REQUEST",
"docs": "https://bannerify.co/docs/api-reference/errors/code/BAD_REQUEST",
"message": "<string>",
"requestId": "req:1234"
}
}{
"error": {
"code": "FORBIDDEN",
"docs": "https://bannerify.co/docs/api-reference/errors/code/FORBIDDEN",
"message": "<string>",
"requestId": "req:1234"
}
}{
"error": {
"code": "NOT_FOUND",
"docs": "https://bannerify.co/docs/api-reference/errors/code/NOT_FOUND",
"message": "<string>",
"requestId": "req:1234"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"docs": "https://bannerify.co/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR",
"message": "<string>",
"requestId": "req:1234"
}
}Authorizations
Body
Your API key. Create one on the API Keys page of the dashboard, and keep it on the server.
"YOUR_API_KEY"
The id of the template to render. In the dashboard, open the menu on a template card and choose Copy Template ID.
"tpl_xxx"
The values to change in the template, as an array of modifications. Each modification names a layer and sets one or more fields, and a layer without a modification keeps the values from the template. An object keyed by layer name and a JSON string of either shape also work. See https://bannerify.co/docs/essentials/modifications.
Show child attributes
Show child attributes
[
{ "name": "headline", "text": "Summer sale" },
{
"name": "photo",
"src": "https://example.com/photo.png"
}
]
Save the generated file to your own S3-compatible bucket instead of Bannerify storage. The response url points to the file in your bucket.
Show child attributes
Show child attributes
Response
The stored PDF.
The public URL of the generated PDF.
"https://images.bannerify.co/files/0b3c1c1e-5d6f-4c52-9e0a-8f6a4c0f2a11.pdf"