Add a font
curl --request POST \
--url https://api.print.app/v2/fonts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"family": "Playfair Display"
}
'import requests
url = "https://api.print.app/v2/fonts"
payload = { "family": "Playfair Display" }
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({family: 'Playfair Display'})
};
fetch('https://api.print.app/v2/fonts', 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.print.app/v2/fonts",
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([
'family' => 'Playfair Display'
]),
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.print.app/v2/fonts"
payload := strings.NewReader("{\n \"family\": \"Playfair Display\"\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.print.app/v2/fonts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"family\": \"Playfair Display\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.print.app/v2/fonts")
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 \"family\": \"Playfair Display\"\n}"
response = http.request(request)
puts response.read_body{
"object": "font",
"family": "playfair display",
"source": "google",
"variants": [
{
"weight": 400,
"style": "normal"
},
{
"weight": 400,
"style": "italic"
},
{
"weight": 700,
"style": "normal"
}
]
}{
"error": true,
"code": "invalid_request",
"message": "width is required.",
"param": "width",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "unauthorized",
"message": "Missing or invalid secret key. Send it as \"Authorization: Bearer sk_…\".",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "account_suspended",
"message": "This account is suspended. Settle the outstanding invoice in the Print.App dashboard.",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "not_found",
"message": "Not found.",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "payload_too_large",
"message": "The file at url is larger than 50 MB.",
"param": "url",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "unsupported_media_type",
"message": "Send the request body as JSON, with \"Content-Type: application/json\".",
"requestId": "FZn-uhymjoEEJow="
}{
"message": "Too Many Requests"
}{
"error": true,
"code": "internal_error",
"message": "Something went wrong on our side. Retry the request; if it keeps failing, contact support with the requestId.",
"requestId": "FZn-uhymjoEEJow="
}Fonts
Add a font
Imports a Google font family by name (every weight and style), or uploads a TTF, OTF or WOFF font file from a public URL.
POST
/
v2
/
fonts
Add a font
curl --request POST \
--url https://api.print.app/v2/fonts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"family": "Playfair Display"
}
'import requests
url = "https://api.print.app/v2/fonts"
payload = { "family": "Playfair Display" }
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({family: 'Playfair Display'})
};
fetch('https://api.print.app/v2/fonts', 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.print.app/v2/fonts",
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([
'family' => 'Playfair Display'
]),
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.print.app/v2/fonts"
payload := strings.NewReader("{\n \"family\": \"Playfair Display\"\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.print.app/v2/fonts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"family\": \"Playfair Display\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.print.app/v2/fonts")
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 \"family\": \"Playfair Display\"\n}"
response = http.request(request)
puts response.read_body{
"object": "font",
"family": "playfair display",
"source": "google",
"variants": [
{
"weight": 400,
"style": "normal"
},
{
"weight": 400,
"style": "italic"
},
{
"weight": 700,
"style": "normal"
}
]
}{
"error": true,
"code": "invalid_request",
"message": "width is required.",
"param": "width",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "unauthorized",
"message": "Missing or invalid secret key. Send it as \"Authorization: Bearer sk_…\".",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "account_suspended",
"message": "This account is suspended. Settle the outstanding invoice in the Print.App dashboard.",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "not_found",
"message": "Not found.",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "payload_too_large",
"message": "The file at url is larger than 50 MB.",
"param": "url",
"requestId": "FZn-uhymjoEEJow="
}{
"error": true,
"code": "unsupported_media_type",
"message": "Send the request body as JSON, with \"Content-Type: application/json\".",
"requestId": "FZn-uhymjoEEJow="
}{
"message": "Too Many Requests"
}{
"error": true,
"code": "internal_error",
"message": "Something went wrong on our side. Retry the request; if it keeps failing, contact support with the requestId.",
"requestId": "FZn-uhymjoEEJow="
}Authorizations
A secret key from Print.App admin → Domains → Secret keys, sent as Authorization: Bearer sk_…. Server-side only.
Headers
Makes a retry safe: a second request with the same key and the same body gets the first response back (for 24 hours) instead of creating the resource again. Use a new key, such as a UUID, for every new request.
Required string length:
1 - 255Body
application/json
- FontCreate
- FontCreate
A Google font family to import, or a font file to upload. Send one of family or url.
A Google Fonts family name, for example Playfair Display. Every weight and style is imported.
Required string length:
1 - 100A public URL of a TTF, OTF, WOFF or WOFF2 file, up to 20 MB. Its family, weight and style are read from the file.
Maximum string length:
2048