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.
| Library | Used in | Category type |
|---|---|---|
| Layer images | Image layers in artworks | clipart, vector, gpx |
| Cliparts | Clipart and vector pickers in artworks | clipart, vector |
| Library images | Masks (artwork and mockup layers), and images reused as backgrounds and thumbnails | image, 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:
| File | Send it as |
|---|---|
| Raster image (PNG, JPEG, GIF, WebP) -- layer images, cliparts, library images | a pre-signed upload (upload_id), or a url |
| SVG -- library images | a pre-signed upload (upload_id), or a url |
| SVG / EPS -- layer images, cliparts | multipart/form-data with a file field, or a url |
| GPX -- layer images | multipart/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:
POST /uploadswith the file'sfilename(.png,.jpg,.jpeg,.gif,.webpor.svg) andfilesize(bytes). You get back anupload_id, anupload_urland theupload_headersto send with it.PUTthe file bytes toupload_urlwith those headers beforeexpires_at(a few minutes).- Call the create endpoint (e.g.
POST /layer-images) with{"upload_id": "..."}. The uploaded file is checked at this point: it must be exactly thefilesizeyou 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 a422. 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 yourPUThas finished you also get a422; that one can simply be retried. Eachupload_idcan 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 samenamealready exists in the same category, return it (200) without uploading. For library images the match is ontype, category andname.replace-- cliparts only, raster images only: replace the image of the existing clipart with the samenamein 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
POST /uploads— Create a pre-signed upload