Skip to main content
Returns all file uploads attached to a chat, with freshly generated presigned download URLs.
Presigned URLs expire after 1 hour. Call this endpoint again to obtain new URLs when needed.
Authorization
string
required
Bearer token obtained from the authenticate endpoint.
chat_id
string
required
Unique identifier of the chat whose uploads to list.

Response

chat_id
string
required
The chat ID the uploads belong to.
uploads
array
required
List of uploads for this chat.
curl -X GET https://api.trellis.sh/v1/chats/chat_abc123/uploads \
  -H "Authorization: Bearer YOUR_TOKEN"
import requests

response = requests.get(
    "https://api.trellis.sh/v1/chats/chat_abc123/uploads",
    headers={"Authorization": "Bearer YOUR_TOKEN"}
)
data = response.json()
for upload in data["uploads"]:
    print(f"{upload['filename']} -> {upload['presigned_url']}")
const response = await fetch(
  "https://api.trellis.sh/v1/chats/chat_abc123/uploads",
  { headers: { Authorization: "Bearer YOUR_TOKEN" } }
);
const { uploads } = await response.json();
uploads.forEach((u) => console.log(u.filename, u.presigned_url));
{
  "chat_id": "chat_abc123",
  "uploads": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "filename": "report.pdf",
      "mime_type": "application/pdf",
      "file_size": 245760,
      "upload_type": "document",
      "presigned_url": "https://s3.amazonaws.com/...",
      "created_at": "2025-06-15T09:30:00Z",
      "message_id": "msg_abc123"
    },
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "filename": "photo.png",
      "mime_type": "image/png",
      "file_size": 512000,
      "upload_type": "image",
      "presigned_url": "https://s3.amazonaws.com/...",
      "created_at": "2025-06-15T09:31:00Z",
      "message_id": "msg_abc123"
    }
  ]
}
{
  "detail": "Chat not found"
}