Files
Images and documents uploaded to the store.
Endpoints#
- GET
/files.jsonList files - GET
/files/count.jsonCount files - GET
/files/{id}.jsonGet a file - POST
/files.jsonUpload a file - PUT
/files/{id}.jsonUpdate a file's alt text - DELETE
/files/{id}.jsonDelete a file
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
The file object#
What the endpoints below return for one file.
{
"id": "cm2file0001",
"url": "https://storeloom.example/uploads/cm2store01/lq1x2y3-9f8e7d6c5b4a.png",
"filename": "size-guide.png",
"mime_type": "image/png",
"media_type": "image",
"size": 48213,
"width": 1200,
"height": 800,
"alt": "Size guide for shirts",
"created_at": "2026-10-23T09:30:00.000Z"
}List files#
/files.jsonread_filesImages, videos and documents in Content → Files, oldest first. url is an absolute link you can use anywhere.
| Parameter | Description |
|---|---|
limit | Results per page, 1–250 (default 50). |
page_info | Cursor from the Link header for the next or previous page. |
since_id | Only results after this id. |
ids | Comma-separated ids. |
media_type | image, video or document. |
mime_type | Exact type, e.g. image/png or application/pdf. |
filename | Files whose name contains this text (any case). |
created_at_min / created_at_max | ISO 8601 bounds on upload time. |
fields | Comma-separated fields to return, e.g. id,url,alt. |
curl "https://store.weftgrid.com/api/admin/2026-10/files.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "files": [ … ] }Count files#
/files/count.jsonread_files| Parameter | Description |
|---|---|
media_type, mime_type, filename, created_at_* | Same filters as the list. |
curl "https://store.weftgrid.com/api/admin/2026-10/files/count.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "count": 21 }Get a file#
/files/{id}.jsonread_filescurl "https://store.weftgrid.com/api/admin/2026-10/files/$FILE_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"file": {
"id": "cm2file0001",
"url": "https://storeloom.example/uploads/cm2store01/lq1x2y3-9f8e7d6c5b4a.png",
"filename": "size-guide.png",
"mime_type": "image/png",
"media_type": "image",
"size": 48213,
"width": 1200,
"height": 800,
"alt": "Size guide for shirts",
"created_at": "2026-10-23T09:30:00.000Z"
}
}Upload a file#
/files.jsonwrite_filesSend the file's contents as base64 in attachment, with its filename. Accepted: JPG, PNG, WebP, GIF and AVIF images, PDFs, CSV and plain text up to 10 MB, and MP4 or WebM videos up to 20 MB. The type is read from the contents, not the name; SVG and HTML files are refused because they can contain scripts. Image width and height are filled in. To register a file hosted elsewhere, send src (an https:// URL) instead: the address is stored as given and never fetched.
{
"file": {
"attachment": "iVBORw0KGgoAAAANSUhEUgAA…",
"filename": "size-guide.png",
"alt": "Size guide for shirts"
}
}curl -X POST "https://store.weftgrid.com/api/admin/2026-10/files.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"file": {
"attachment": "iVBORw0KGgoAAAANSUhEUgAA…",
"filename": "size-guide.png",
"alt": "Size guide for shirts"
}
}'Example responseShowHide
{
"file": {
"id": "cm2file0001",
"url": "https://storeloom.example/uploads/cm2store01/lq1x2y3-9f8e7d6c5b4a.png",
"filename": "size-guide.png",
"mime_type": "image/png",
"media_type": "image",
"size": 48213,
"width": 1200,
"height": 800,
"alt": "Size guide for shirts",
"created_at": "2026-10-23T09:30:00.000Z"
}
}Update a file's alt text#
/files/{id}.jsonwrite_filesOnly alt can change; upload a new file to replace the contents.
{ "file": { "alt": "Size guide for shirts and jackets" } }curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/files/$FILE_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "file": { "alt": "Size guide for shirts and jackets" } }'Example responseShowHide
{
"file": {
"id": "cm2file0001",
"url": "https://storeloom.example/uploads/cm2store01/lq1x2y3-9f8e7d6c5b4a.png",
"filename": "size-guide.png",
"mime_type": "image/png",
"media_type": "image",
"size": 48213,
"width": 1200,
"height": 800,
"alt": "Size guide for shirts",
"created_at": "2026-10-23T09:30:00.000Z"
}
}Delete a file#
/files/{id}.jsonwrite_filesRemoves the file from the library and deletes the uploaded copy. Products, pages or posts that still show it will show a broken image.
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/files/$FILE_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{}