FilesClient
client.files handles binary uploads and file metadata. It's used both directly (attach a file to something) and indirectly (client.activities.upload() delegates straight to it).
upload(options)
Section titled “upload(options)”await client.files.upload({ file, // Blob or Node Buffer filename, contentType, title, summary, to, parentObject, // the file inherits this object's visibility at serve time generateThumbnail, thumbnailSizes,})upload() builds a FormData payload by hand, handling both browser Blob inputs and Node Buffer inputs. It bypasses HttpClient entirely and calls fetch() directly, because HttpClient always JSON-stringifies its request body -- which doesn't work for multipart form data -- and manually attaches the bearer token to the raw request instead of going through HttpClient's normal header-building path.
list, getMeta, delete
Section titled “list, getMeta, delete”client.files.list({ type, page, limit })client.files.getMeta(fileId) // bare string, not an options objectclient.files.delete(fileId) // bare string, not an options objectserveUrl(fileId, options)
Section titled “serveUrl(fileId, options)”client.files.serveUrl(fileId, { size, token })This is a pure URL builder -- it does not make an HTTP request. It returns the /files/:id proxy URL a browser or app can point an <img>/<video>/download link at directly. size requests a specific thumbnail variant. token exists specifically for contexts where you can't set request headers (like an <img src> attribute) -- it lets you authenticate the file request via a query parameter instead of an Authorization header.