Register an uploaded file

POST/chat-rooms/:roomId/files

Register a file that was PUT to S3. The server verifies the real size and rejects anything over 10MB. If a file with the same name exists in the folder, it is numbered as "report (2).pdf". Set postToChat to true to also post it to the chat.

AuthLogin required

Path parameters

roomIdstringrequired

Chat room ID.

Request body

uploadKeystringrequired

The uploadKey returned by the upload-url endpoint.

fileNamestringrequired

Display name for the file.

folderIdstring

Destination folder; omit or null for the root.

postToChatboolean

Post the file to the chat as a message.

contentstring

Message body when postToChat is set.

replyToIdstring

Message being replied to, when postToChat is set.

Request
curl https://api.4s.link/chat-rooms/ROOM_ID/files \
-X POST \
-H "Authorization: Bearer 4s_at_..." \
-H "Content-Type: application/json" \
-d '{
"uploadKey": "chat-file-uploads/r1a2b3c4-.../a1b2c3d4-.../....pdf",
"fileName": "report.pdf",
"folderId": null,
"postToChat": true
}'
Example response
{
"type": "file",
"id": "cf1a2b3c-...",
"name": "report.pdf",
"folderId": null,
"mimeType": "application/pdf",
"size": 1234567,
"messageId": null,
"createdAt": "2026-08-29T00:00:00.000Z"
}