Skip to main content
Clody’s built-in CDN lets you attach images, videos, documents, and GIFs to Branch messages and Picnic posts, and update your profile or community avatar — all from a simple multipart upload. This guide explains every upload endpoint, how to serve files back to clients, and the limits that apply.

Size and Attachment Limits

Branch File Uploads

Upload a File

POST /api/cdn/benches/upload — multipart form data You must be a member of the specified Branch.
Response:
Use the filename value in the cdn array when you call POST /api/bm/create:

Retrieve a Branch File

GET /cdn/benches/<branch_id>/<filename>
Only members of the Branch can access its CDN files. The server returns 403 if you are not a member.

Attach a GIF to a Branch Message

Instead of uploading a GIF file manually, use the dedicated GIF proxy endpoint. It fetches the GIF from Giphy’s CDN and stores it on Clody’s servers.

Search for a GIF

POST /api/gifs/search
string
Search query. Omit or leave empty to get trending GIFs.
Response — up to 24 results:

Save the GIF to a Branch

POST /api/cdn/benches/gif
number
required
The Branch ID where you will attach the GIF.
string
required
The full Giphy URL returned by /api/gifs/search. Only giphy.com URLs are accepted.
Response:
Include the filename in the cdn array of your POST /api/bm/create call just like any other file.

Picnic File Uploads

Admins can upload files to attach to Picnic posts.

Upload a File

POST /api/cdn/picnics/upload — multipart form data, admin required
Response:
Include the filename in the cdn array of POST /api/pm/create.

Retrieve a Picnic File

GET /cdn/picnics/<picnic_id>/<filename>
Picnic files are accessible to any logged-in user (the Picnic does not need to be joined).

Avatar Uploads

Update Your User Avatar

POST /api/cdn/avatars/upload — multipart form data Uploading a new avatar immediately replaces your current one. No separate update call is needed.
Response:

Update a Picnic’s Avatar

POST /api/cdn/picnics/avatars/upload — multipart form data, owner required, max 5 MB
Response:
After a successful upload, all Picnic members receive an update_picnic Socket.IO event with the refreshed Picnic object.

Retrieve an Avatar

GET /cdn/avatar/<filename>
This endpoint serves both user avatars and Picnic avatars (both are stored in the same cdn/avatars directory).

Error Reference