Resource Guide

Image Library

The Image Library holds the images your account reuses, such as logos and product shots, with folders, labels and a version history. These endpoints manage the library. They never change a design.

The library needs an account API key and a plan with the Image Library. A Store API Key gets a 403.

Browse and search

Reference

Filter with folderId (a folder, or top for images in no folder), labelId (repeat it for several) and deleted=true. Sort by newest, oldest, name, updated, largest, most-used or best. Pages hold up to 200 images.

With q you get one page of at most 50 images and no cursor. Add more words to narrow it. The response also lists the folders and labels that match.

Each image says why it matched in match: kind is description, label, folder, fileName or olderFileName, text is what it matched on, and version is set for an older file name. match is null when the image matched on its own name. A folder's name reaches every image under it, so a search can find an image with nothing else in common with your words.

curl "https://dev.niftyimages.com/v2/library-images?q=dark%20logo" \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY"

Add an image

Reference

Send a file as multipart form data, with optional name, description, folderId and labelIds. JPEG, PNG, GIF, WebP and SVG are accepted, up to your plan's file size. A larger file gets a 413.

curl https://dev.niftyimages.com/v2/library-images \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY" \
  -F "file=@logo.png" \
  -F "name=Logo Dark"

Or give a public HTTPS URL. The URL can't redirect, and it has to answer within 10 seconds.

curl https://dev.niftyimages.com/v2/library-images/from-url \
  -H "Authorization: Bearer $NIFTYIMAGES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/logo.png","name":"Logo Dark"}'

Adding is safe to retry once the first try has answered; two adds of the same file at the same moment can both land. Images go up to the plan's file size and 64 megapixels, then 413. An SVG draws only what's inside the file, so images it links to elsewhere stay blank. A new image answers 201. A file that's already in the library answers 200 with "duplicate": true and the image that has those bytes, and adds nothing. Send addIfDuplicate as true to add it anyway.

Read an image

Reference

GET /v2/library-images/{id} returns the image and its versions. /uses lists the designs that use it, and each imageId there is an id in Images. /file downloads the original, and ?version= picks an older one.

thumbnailUrl needs no key and lasts 10 minutes. Fetch a fresh one from a new response when it expires.

Change and delete

Reference

PATCH sets name, description, folderId and labelIds. Leave a field out to keep it. "folderId": null moves the image to the top level, and labelIds replaces the whole list.

DELETE moves an image to Deleted, and POST /v2/library-images/{id}/restore brings it back. Designs that use a deleted image keep showing it.

Folders and labels

Reference

/v2/library-folders and /v2/library-labels list, add, change and delete. Folders go 7 levels deep. Deleting a folder deletes the folders inside it and moves their images to Deleted. Deleting a label takes it off every image. Adding a label that already exists returns that label.