List media

List the workspace’s media library, which every site in the workspace shares.

GET https://sitepaste.com/api/v1/public/media

Requires the media scope.

Usage

curl "https://sitepaste.com/api/v1/public/media?limit=50" \
  -H "Authorization: Bearer $TOKEN"

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Query parameters

ParameterTypeRequiredDescription
qstringNoNarrow to files whose id or note contains this text. Max 200 bytes; longer is a 422.
limitintegerNoHow many to return, 1 to 1000. Defaults to 1000.
offsetintegerNoHow many to skip. Defaults to 0.

limit and offset page through whatever q matched. See paging.

Response

{
  "media": [
    {
      "fileId": "a1b2c3d4.webp",
      "url": "https://media.example.com/media/.../a1b2c3d4.webp",
      "mimeType": "image/webp",
      "sizeBytes": 84213,
      "width": 1600,
      "height": 1067,
      "protected": false,
      "thumbnailUrl": "https://media.example.com/media/.../a1b2c3d4.webp.thumb.jpg",
      "folderId": "f8qjx2v7mz4r",
      "note": "Cover shot",
      "originalFilename": "beach.jpg",
      "capturedAt": "2026-06-01T09:00:00Z",
      "createdAt": "2026-06-02T12:00:00Z"
    }
  ],
  "total": 214,
  "limit": 1000,
  "offset": 0
}
FieldTypeDescription
fileIdstringThe file’s ID. Use it for updating and deleting.
urlstringWhere the file is served from. A protected file’s URL is a /media/ path that opens only for visitors who can open a page that shows it.
mimeTypestringDetected content type.
sizeBytesintegerFile size. Omitted when unknown.
width, heightintegerImage or video dimensions. Omitted for other types.
durationMsintegerAudio or video duration. Omitted for other types.
protectedbooleanWhether the file needs a password or a workspace sign-in to view.
thumbnailUrlstringGenerated thumbnail. Omitted when there is none.
transcodeStatusstringpending, processing, complete, or failed. Omitted for files that need no transcode.
folderIdstringThe folder the file is in. Omitted when unfiled.
notestringThe file’s note. Omitted when unset.
originalFilenamestringThe name the file was uploaded under. Omitted when unknown.
capturedAtstringRFC 3339. When the photo or video was taken, read from the file. Omitted when unknown.
sortOrderintegerManual position within its folder. Omitted when the folder is not manually ordered.
createdAtstringRFC 3339.

total counts every file the request matched, not only the ones in this response.

Files are ordered by upload time, newest first.