Resource Guide

Fonts

Fonts control the text styles available to generated images. Use the Fonts API to discover built-in fonts, upload account fonts, and remove custom fonts you no longer need.

Added fonts are account-scoped. The API validates each font by rendering a sample before saving it.

List fonts

Reference

List every font available to the authenticated account. Results include both built-in fonts and your uploaded fonts.

curl https://dev.niftyimages.com/v2/fonts \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY"

List built-in fonts

Reference

Use scope=public when you only need built-in fonts.

curl "https://dev.niftyimages.com/v2/fonts?scope=public" \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY"

List uploaded fonts

Reference

Use scope=user to list only fonts uploaded by the authenticated account.

curl "https://dev.niftyimages.com/v2/fonts?scope=user" \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY"

Add a font from a URL

Reference

Add a custom font by sending a public font URL and, optionally, a display name. Font files must be 10 MB or smaller.

curl https://dev.niftyimages.com/v2/fonts/from-url \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://cdn.example.com/fonts/campaign-display.ttf",
    "name": "Campaign Display"
  }'

Upload a font file

Reference

Send multipart form data when you already have the font file locally. Use the file field for the font and, optionally, a display name.

curl https://dev.niftyimages.com/v2/fonts \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY" \
  -F "name=Campaign Display" \
  -F "file=@./campaign-display.ttf"

Delete an uploaded font

Reference

Delete a custom font owned by the authenticated account. Built-in fonts cannot be deleted.

curl -X DELETE https://dev.niftyimages.com/v2/fonts/{id} \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY"