Skip to main content

List Files

GET /api/v1/workspaces/{workspaceId}/storage
type
string
default:"all"
all · images · deliverables · documents · files
limit
number
default:"50"
Capped at 200.
Filename search (partial match).
files
StorageFile[]
totals
object
{ images, deliverables, documents, files } counts
hasMore
boolean
curl "https://suite.sundaypyjamas.com/api/v1/workspaces/ws_123/storage?type=documents&limit=20" \
  -H "Authorization: Bearer spj_ai_your_api_key_here"

Get File Content

GET /api/v1/workspaces/{workspaceId}/storage/content
fileId
string
required
fileType
string
required
image · deliverable · document · file
Streams the raw file with Content-Type set to the stored MIME type and Content-Disposition: inline.
curl "https://suite.sundaypyjamas.com/api/v1/workspaces/ws_123/storage/content?fileId=file_1&fileType=document" \
  -H "Authorization: Bearer spj_ai_your_api_key_here" \
  -o downloaded-file.pdf

Move or Rename File

PATCH /api/v1/workspaces/{workspaceId}/storage/files/{fileId}
action
string
default:"rename"
move or rename
destFolderPath
string
Required when action is move.
newName
string
Required when action is rename.
curl -X PATCH https://suite.sundaypyjamas.com/api/v1/workspaces/ws_123/storage/files/file_1 \
  -H "Authorization: Bearer spj_ai_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "action": "move", "destFolderPath": "/archive" }'
{ "file": { "id": "file_1", "filename": "report.pdf", "path": "/archive/report.pdf", "...": "..." } }
There is also a bulk variant of this operation at PATCH /api/v1/workspaces/{workspaceId}/storage/files — same body shape, plus a top-level fileId field to select the target file.

Errors

StatusError
400fileId is required / destFolderPath is required for move / newName is required for rename
400Missing fileId or fileType (Get Content)
401Unauthorized
404File not found / Storage key not found / Empty file