chatbot_id is provided, the uploaded file will be linked with the AI Agent as a knowledge asset. If chatbot_id is not provided, the file will only be uploaded and the API will return the uploaded file asset_url.| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | Unique identifier of the project where the file should be uploaded. |
| Name | Type | Required | Description |
|---|---|---|---|
chatbot_id | string | No | Unique chatbot identifier. If provided, the uploaded file will be linked with this agent. If not provided, the file will only be uploaded. |
file | file | Yes | File to upload as a project asset. Maximum allowed file size is 10 MB. |
metadata | string | No | Optional metadata for the uploaded file. This can be a JSON string containing source, category, tags, or other custom details. |
| Rule | Value |
|---|---|
| Maximum file size | 10 MB |
| Supported file types | PDF, DOCX, DOC, XLS, XLSX, TXT, HTML, MD, Markdown, JSON |
chatbot_id is not provided.{
"message": "File uploaded successfully",
"data": {
"status": "Uploaded",
"asset_url": "https://chatbot-ai-agent.s3.eu-west-1.amazonaws.com/projects/123/sample.pdf"
}
}chatbot_id is provided.{
"message": "Chatbot asset linkage initiated.",
"data": {
"linkage_id": 6548,
"chatbot_id": "DKDvwn...",
"asset_id": 5782,
"status": "Processing"
}
}| Field | Type | Description |
|---|---|---|
message | string | Human-readable response message. |
data | object | Response data object. |
data.linkage_id | integer | Unique identifier of the link created between the chatbot and uploaded file. Returned only when chatbot_id is provided. |
data.chatbot_id | string | Unique chatbot identifier linked with the uploaded file. Returned only when chatbot_id is provided. |
data.asset_id | integer | Unique identifier of the uploaded file asset. Returned when the file is linked with a chatbot. |
data.status | string | Current upload or linking status. Example values: Uploaded, Processing, Linked, Failed. |
data.asset_url | string | URL of the uploaded file asset. Returned when the file is uploaded without chatbot linking. |
{
"message": "Bad Request",
"error": {
"code": "BAD_REQUEST",
"detail": "File is required, file size must not exceed 10 MB, and file type must be one of PDF, DOCX, DOC, XLS, XLSX, TXT, HTML, MD, Markdown, or JSON."
}
}{
"message": "Unauthorized",
"error": {
"code": "UNAUTHORIZED",
"detail": "Authentication token is missing or invalid."
}
}{
"message": "Forbidden",
"error": {
"code": "FORBIDDEN",
"detail": "You do not have permission to upload or link files for this project."
}
}{
"message": "Not Found",
"error": {
"code": "CHATBOT_NOT_FOUND",
"detail": "Project or chatbot not found."
}
}{
"message": "Internal Server Error",
"error": {
"code": "INTERNAL_SERVER_ERROR",
"detail": "Something went wrong. Please try again later."
}
}multipart/form-data.file field is required.PDF, DOCX, DOC, XLS, XLSX, TXT, HTML, MD, Markdown, and JSON.chatbot_id field is optional.chatbot_id is provided, the uploaded file will be linked with the chatbot and processed as a knowledge asset.chatbot_id is not provided, the file will only be uploaded and the API will return asset_url.curl --location 'https://agents.robofy.ai/v1/ai-agent/link_file/' \
--header 'Authorization: Bearer <token>' \
--form 'chatbot_id=""' \
--form 'file=@""' \
--form 'metadata=""'{
"message": "Chatbot asset linkage initiated.",
"data": {
"linkage_id": 6548,
"chatbot_id": "DKDvwn...",
"asset_id": 5782,
"status": "Processing"
}
}