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"
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,
}
);
{
"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"
}
}
{
"object": "error",
"status": 400,
"code": "validation_error",
"message": "File exceeds maximum size of 50 MB"
}
Assets
Upload Asset
Upload a file to a board’s asset storage.
POST
/
v1
/
boards
/
{boardId}
/
assets
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"
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,
}
);
{
"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"
}
}
{
"object": "error",
"status": 400,
"code": "validation_error",
"message": "File exceeds maximum size of 50 MB"
}
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
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"
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,
}
);
{
"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"
}
}
{
"object": "error",
"status": 400,
"code": "validation_error",
"message": "File exceeds maximum size of 50 MB"
}
⌘I