Upload a file to the room’s R2 object storage.
Endpoint
POST /v1/accounts/:accountId/upload
Authentication
Bearer token required.
Request Body
multipart/form-data with the following fields:
The room to associate the file with.
The user uploading the file.
Response
Example
curl -X POST https://api.collab-kit.com/v1/accounts/${ACCOUNT_ID}/upload \
-H "Authorization: Bearer ${TOKEN}" \
-F "roomId=c3003c93-60cf-4184-b85f-20be14d26dac" \
-F "userId=user-001" \
-F "file=@./screenshot.png"
{
"type": "response",
"success": true,
"description": "File uploaded",
"data": {
"file": {
"key": "c3003c93/uploads/screenshot.png",
"url": "https://api.collab-kit.com/v1/accounts/${ACCOUNT_ID}/storage/c3003c93/uploads/screenshot.png"
}
},
"error": null
}