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

# Upload Asset

> Upload a file to a board's asset storage.

**Maximum file size:** 50 MB

**Allowed content types:**

* Images: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml`
* Documents: `application/pdf`, `.docx`, `.xlsx`, `.pptx`
* Text: `text/plain`, `text/csv`
* Audio: `audio/mpeg`, `audio/wav`
* Video: `video/mp4`

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.chatgrid.ai/v1/boards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/assets" \
    -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
    -F "file=@/path/to/report.pdf"
  ```

  ```typescript Node.js theme={null}
  const formData = new FormData();
  formData.append("file", fs.createReadStream("/path/to/report.pdf"));

  const response = await fetch(
    "https://api.chatgrid.ai/v1/boards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/assets",
    {
      method: "POST",
      headers: { Authorization: "Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" },
      body: formData,
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "object": "asset",
    "data": {
      "id": "1711843260000-report.pdf",
      "url": "https://storage.chatgrid.ai/board-files/usr_123/brd_456/1711843260000-report.pdf",
      "filename": "1711843260000-report.pdf",
      "original_filename": "report.pdf",
      "storage_path": "usr_123/brd_456/1711843260000-report.pdf",
      "size": 245760,
      "content_type": "application/pdf"
    }
  }
  ```

  ```json 400 (file too large) theme={null}
  {
    "object": "error",
    "status": 400,
    "code": "validation_error",
    "message": "File exceeds maximum size of 50 MB"
  }
  ```
</ResponseExample>
