Skip to content

Asset Libraries ​

Upload and look up the reusable images in your Teeinblue libraries -- the same libraries you manage in the portal. Use these endpoints to push material from your own storage instead of uploading it by hand or through an AI agent.

LibraryUsed inCategory type
Layer imagesImage layers in artworksclipart, vector, gpx
ClipartsClipart and vector pickers in artworksclipart, vector
Library imagesMasks (artwork and mockup layers), and images reused as backgrounds and thumbnailsimage, mask (the image's own type; categories hold one type)

Abilities. Read endpoints need assets:read; create and delete endpoints need assets:write.

Sending a file. How you send a file depends on its kind -- the same way the portal does:

FileSend it as
Raster image (PNG, JPEG, GIF, WebP) -- layer images, cliparts, library imagesa pre-signed upload (upload_id), or a url
SVG -- library imagesa pre-signed upload (upload_id), or a url
SVG / EPS -- layer images, clipartsmultipart/form-data with a file field, or a url
GPX -- layer imagesmultipart/form-data with a file field, or a url

Pre-signed upload (raster images, and SVGs for library images). The image bytes go straight to storage, not through this API:

  1. POST /uploads with the file's filename (.png, .jpg, .jpeg, .gif, .webp or .svg) and filesize (bytes). You get back an upload_id, an upload_url and the upload_headers to send with it.
  2. PUT the file bytes to upload_url with those headers before expires_at (a few minutes).
  3. Call the create endpoint (e.g. POST /layer-images) with {"upload_id": "..."}. The uploaded file is checked at this point: it must be exactly the filesize you declared, at most 64 MB, and an image the endpoint takes -- judged from the file's content, not its name -- otherwise the upload is removed and you get a 422. Layer images and cliparts take a PNG, JPEG, GIF or WebP this way (send their SVGs as multipart); library images also take an SVG. If you call before your PUT has finished you also get a 422; that one can simply be retried. Each upload_id can be used once.
bash
# 1. Request a presigned upload
curl -X POST https://api.teeinblue.com/openapi/v1/uploads \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"filename": "SKU123_BG.png", "filesize": 8388608}'
# => { "upload_id": "...", "upload_url": "https://...",
#      "upload_headers": {"Content-Type": "image/png"},
#      "expires_at": "..." }

# 2. PUT the bytes straight to storage, sending the headers from upload_headers.
#    No Authorization header here -- the upload_url carries its own signature.
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary @SKU123_BG.png

# 3. Create the item
curl -X POST https://api.teeinblue.com/openapi/v1/layer-images \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"upload_id": "..."}'

URL. Send application/json with a url that Teeinblue downloads. The URL must be publicly reachable over http(s) (a signed cloud-storage URL works). Redirects are not followed -- give the final, direct URL of the file -- and URLs that point to private or internal network addresses are refused.

Each file may be at most 64 MB, whichever way it is sent. Larger files are rejected with 422.

A raster layer image or library image may be at most 128 megapixels (width x height), read from the file's header whichever way it is sent. A larger image, or one whose size cannot be read (a corrupt or truncated file), is refused with 422 and the upload is removed. SVGs have no pixel limit.

Processing. Raster images are processed in the background: the create call returns 201 with status: processing, and url / thumbnail_url are null until processing finishes. Poll the item's GET endpoint until status is ready. SVG/EPS and GPX files are processed during the request and come back ready, as do library image SVGs.

Duplicates. By default every upload creates a new item, as in the portal. Pass on_duplicate to make a re-run of your upload script safe:

  • create (default) -- always create a new item.
  • skip -- if an item with the same name already exists in the same category, return it (200) without uploading. For library images the match is on type, category and name.
  • replace -- cliparts only, raster images only: replace the image of the existing clipart with the same name in the same category, keeping its id (the portal's "Replace items"). As in the portal, SVG/EPS cliparts cannot be replaced.

Using an item in an artwork. url is a storage key such as users/4965/image-layers/68c0006568e69_large.webp. Put it in a layer exactly as returned -- do not prefix it with a domain. thumbnail_url is a full URL meant only for previews. A library image is used the same way: a mask image's url goes into a layer's mask field (e.g. masked_url), an image's url into a background field (e.g. background_image).

Limits. Uploads count towards the same daily limits as uploads made in the portal. When a limit is reached the API returns 429 (see "TooManyRequests" below for the two kinds of limit that can trigger it). These daily limits are separate from the account-wide per-minute request limit described in "Rate Limiting".

Endpoints ​

Teeinblue API documentation.