Browse the API docs

Files

Images and documents uploaded to the store.

Endpoints#

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.

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#

GET/files.jsonread_files

Images, videos and documents in Content → Files, oldest first. url is an absolute link you can use anywhere.

Query parameters
ParameterDescription
limitResults per page, 1–250 (default 50).
page_infoCursor from the Link header for the next or previous page.
since_idOnly results after this id.
idsComma-separated ids.
media_typeimage, video or document.
mime_typeExact type, e.g. image/png or application/pdf.
filenameFiles whose name contains this text (any case).
created_at_min / created_at_maxISO 8601 bounds on upload time.
fieldsComma-separated fields to return, e.g. id,url,alt.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/files.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "files": [ … ] }

Count files#

GET/files/count.jsonread_files
Query parameters
ParameterDescription
media_type, mime_type, filename, created_at_*Same filters as the list.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/files/count.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "count": 21 }

Get a file#

GET/files/{id}.jsonread_files
Request
curl "https://store.weftgrid.com/api/admin/2026-10/files/$FILE_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "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#

POST/files.jsonwrite_files

Send 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.

Request body
{
  "file": {
    "attachment": "iVBORw0KGgoAAAANSUhEUgAA…",
    "filename": "size-guide.png",
    "alt": "Size guide for shirts"
  }
}
Request with curl
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 responseShow
{
  "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#

PUT/files/{id}.jsonwrite_files

Only alt can change; upload a new file to replace the contents.

Request body
{ "file": { "alt": "Size guide for shirts and jackets" } }
Request with curl
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 responseShow
{
  "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#

DELETE/files/{id}.jsonwrite_files

Removes the file from the library and deletes the uploaded copy. Products, pages or posts that still show it will show a broken image.

Request
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/files/$FILE_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{}