> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trellis.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# List Uploads

> List all file uploads for a chat with download URLs

Returns all file uploads attached to a chat, with freshly generated presigned download URLs.

<Note>
  Presigned URLs expire after 1 hour. Call this endpoint again to obtain new URLs when needed.
</Note>

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the authenticate endpoint.
</ParamField>

<ParamField path="chat_id" type="string" required>
  Unique identifier of the chat whose uploads to list.
</ParamField>

## Response

<ResponseField name="chat_id" type="string" required>
  The chat ID the uploads belong to.
</ResponseField>

<ResponseField name="uploads" type="array" required>
  List of uploads for this chat.

  <Expandable title="Upload object">
    <ResponseField name="id" type="string" required>
      Unique identifier for the upload.
    </ResponseField>

    <ResponseField name="filename" type="string" required>
      Original filename.
    </ResponseField>

    <ResponseField name="mime_type" type="string" required>
      MIME type of the uploaded file.
    </ResponseField>

    <ResponseField name="file_size" type="integer" required>
      File size in bytes.
    </ResponseField>

    <ResponseField name="upload_type" type="string" required>
      Either `"document"` or `"image"`.
    </ResponseField>

    <ResponseField name="presigned_url" type="string" required>
      Temporary download URL for the file. Expires after 1 hour.
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      ISO 8601 timestamp when the upload was created.
    </ResponseField>

    <ResponseField name="message_id" type="string | null">
      ID of the chat message this upload is attached to. `null` if the upload has not yet been linked to a message via `upload_ids`.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET https://api.trellis.sh/v1/chats/chat_abc123/uploads \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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']}")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "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"
      }
    ]
  }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Chat not found"
  }
  ```
</ResponseExample>
