Chat

Create a download URL

GET/chat-rooms/:roomId/files/:fileId/url

Files are private, so fetch a short-lived URL each time. disposition=inline is honoured only for allowed types such as PDF; anything else is forced to attachment. The URL carries the file name, so opening it as a link downloads the file.

AuthLogin required

Path parameters

roomIdstringrequired

Chat room ID.

fileIdstringrequired

File ID.

Query parameters

dispositionstringoptional

attachment (default) or inline.

Response

FieldTypeDescription
urlstringPre-signed URL for the file.
expiresInnumberLifetime of the URL in seconds.
expiresAtstringExpiry time of the URL (ISO 8601).
fileName / mimeType / sizemixedFile name, MIME type and size in bytes.
disposition'inline' | 'attachment'How the browser should open it; inline for PDFs and images.
Request
curl https://api.4s.link/chat-rooms/ROOM_ID/files/FILE_ID/url \
-H "Authorization: Bearer 4s_at_..."
Example response
{
"url": "https://.../chat-files/...?X-Amz-Signature=...",
"expiresIn": 300,
"expiresAt": "2026-08-29T00:05:00.000Z",
"fileName": "report.pdf",
"mimeType": "application/pdf",
"size": 1234567,
"disposition": "inline"
}