Robofy API
HomeChangelog
HomeChangelog
Visit Website
Sign In
Create an account
  1. Content
  • Start Guide
    • Overview
    • Architecture
    • Authentication
    • Changelog
  • Robofy API
    • Chat
      • Generate Client Token (Handshake)
      • Send Message (Streaming)
      • Send Message (Non Streaming)
      • Send WhatsApp Message
    • Chatbot / Agent
      • List Agents
      • Create Agent
      • Retrieve Agent
      • Update Agent
      • Delete Agent
      • Delink Asset
      • List Linked Assets
      • Delete Widget Tab
    • Account
      • Retrieve Account Details
      • Update Account Details
      • Retrieve Account Limit
    • Prompt & Persona
      • Update System Prompt
      • Retrieve Agent Settings
      • Update Persona
      • Retrieve Persona
    • Inbox
      • List Sessions
      • List Session Messages
    • Project
      • Create Project
      • List Projects
      • Update Project
      • Retreive Project
    • Leads
      • List Leads
    • Content
      • Add Website
        POST
      • Get Crawl Status
        GET
      • Add Text Content
        POST
      • Add File
        POST
    • Stats
      • Stats
    • License
      • Create License
      • List License
      • Update License
      • Retrieve License
      • Delete License
      • Update License Limit
    • Partner
      • Onboard
    • Schemas
      • Account
      • AccountDetailDto
      • Address
      • AgentCredentialInsertResponseDto
      • AgentCredentialRequestDto
      • AgentCredentialResponseDto
      • AgentDataPoint
      • AgentLeadCapture
      • AgentLeadReportDto
      • AgentLinkageDto
      • AgentMcpServerDto
      • AgentMcpServerInsertResponseDto
      • AgentMcpServerRequestDto
      • AgentMcpServerUpdateRequestDto
      • AgentPromptVersionDto
      • AgentSessionListDto
      • AgentSessionListItemDto
      • AgentStatsDto
      • AgentThemeDto
      • AgentThemeListDto
      • AgentToolLinkageInsertResponseDto
      • AgentToolLinkageRequestDto
      • AgentWhatappIntrgrationResponse
      • AgentWhatsAppLinkageDto
      • Button
      • CarouselCard
      • CategoryStats
      • ChatBotDetailsDto
      • ChatBotDetailsRequest
      • ChatBotDetailsUpdateRequest
      • ChatbotAISettingsDto
      • ChatbotAISettingsRequest
      • ChatbotAdvanceSettingsDto
      • ChatbotAdvanceSettingsRequest
      • ChatbotAppearanceSettingsDto
      • ChatbotAppearanceSettingsRequest
      • ChatbotAssetDelinkDto
      • ChatbotAssetLinkageDataDto
      • ChatbotAssetLinkageDelinkRequest
      • ChatbotAssetLinkageDetailsDto
      • ChatbotAssetLinkageDto
      • ChatbotAssetLinkageRequest
      • ChatbotTextLinkageRequest
      • ClientData
      • CommonResponse
      • Component
      • Contact
      • ContactName
      • CrawlStatusDto
      • CrawlWebsiteRequest
      • CreateOrUpdateProjectRequest
      • CreatePhoneNumberRequest
      • CreateTemplateRequest
      • CreateWebhookConfigRequest
      • DeLinkWhatsAppRequest
      • Email
      • Error
      • ErrorResponse
      • Example
      • FailureStats
      • FailureStatsDataPoint
      • FormField
      • GoogleSheetDto
      • GoogleSheetIntegrationRequest
      • InboxChatDto
      • InboxDto
      • InboxMessage
      • InboxSession
      • IntelligentMetricsDto
      • Interactive
      • InteractiveAction
      • InteractiveBody
      • InteractiveButton
      • InteractiveFooter
      • InteractiveHeader
      • InteractiveMedia
      • InteractiveProductItem
      • InteractiveProductSection
      • InteractiveReply
      • InteractiveRow
      • InteractiveSection
      • LeadCaptureForm
      • LeadData
      • LeadDataField
      • LeadFormData
      • LeadReport
      • LicenseCreateRequest
      • LicenseDto
      • LicenseLimitRequest
      • LicenseUpdateRequest
      • LimitedTimeOffer
      • LinkWhatsAppRequest
      • LinkedCredentialDto
      • LinkedMcpServerDto
      • Location
      • Media
      • MessageMetaData
      • MessageRequest
      • MessageResponse
      • MessageStats
      • MessageStatsDataPoint
      • MessageTemplate
      • NamedParameter
      • OrgLimitDto
      • Organization
      • PaginatedWebhookLogsResponse
      • Part
      • PartnerClientSession
      • PartnerClientSessionDto
      • Phone
      • PhoneNumberRequest
      • PhoneVerifyCodeRequest
      • PhoneVerifyRequest
      • PlatformStats
      • ProjectDetailDto
      • ProjectWABADetail
      • Reaction
      • ReadTypingIndicatorRequest
      • RecentInsightDto
      • Response
      • SessionInsightItemDto
      • SessionInsightsDto
      • SessionMetaDto
      • SessionMetricsDto
      • SessionSummaryDetailDto
      • StartUrl
      • SubcribedAppsRequest
      • SupportedApp
      • TemplateAction
      • TemplateButtons
      • TemplateCarousel
      • TemplateComponent
      • TemplateCurrency
      • TemplateDateTime
      • TemplateLimitedTimeOffer
      • TemplateMedia
      • TemplateParameter
      • TemplateProductItem
      • TemplateSection
      • TemplateTapTargetConfiguration
      • Text
      • ThemeMetaDto
      • TypingIndicator
      • UpdateOnboardStatusRequest
      • UpdateOnboardStatusResponseDto
      • UploadMedia
      • Url
      • WABADetail
      • WABADto
      • Webhook
      • WebhookConfigDto
      • WebhookConfiguration
      • WebhookLogDto
      • WebsiteDto
      • WhatsAppBusinessApiData
      • WhatsAppBusinessProfile
      • WidgetIntegration
  1. Content

Add File

POST
/v1/ai-agent/link_file/{projectId}
Add File API allows you to upload a file as a project asset and optionally link it with an AI Agent.
This endpoint is used when you want to upload documents or knowledge files. If 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.

Endpoint#


Request Content Type#


Path Parameters#

NameTypeRequiredDescription
projectIdintegerYesUnique identifier of the project where the file should be uploaded.

Body Parameters#

NameTypeRequiredDescription
chatbot_idstringNoUnique chatbot identifier. If provided, the uploaded file will be linked with this agent. If not provided, the file will only be uploaded.
filefileYesFile to upload as a project asset. Maximum allowed file size is 10 MB.
metadatastringNoOptional metadata for the uploaded file. This can be a JSON string containing source, category, tags, or other custom details.

File Upload Limitations#

RuleValue
Maximum file size10 MB
Supported file typesPDF, DOCX, DOC, XLS, XLSX, TXT, HTML, MD, Markdown, JSON

Request Example: Upload File Only#

Use this request when you only want to upload a file and get the uploaded file URL.

Request Example: Upload File and Link With Agent#

Use this request when you want to upload a file and link it with a agent.

Success Response: File Uploaded Only#

Returned when 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"
  }
}

Success Response: File Uploaded and Linked With Agent#

Returned when chatbot_id is provided.
{
  "message": "Chatbot asset linkage initiated.",
  "data": {
    "linkage_id": 6548,
    "chatbot_id": "DKDvwn...",
    "asset_id": 5782,
    "status": "Processing"
  }
}

Response Fields#

FieldTypeDescription
messagestringHuman-readable response message.
dataobjectResponse data object.
data.linkage_idintegerUnique identifier of the link created between the chatbot and uploaded file. Returned only when chatbot_id is provided.
data.chatbot_idstringUnique chatbot identifier linked with the uploaded file. Returned only when chatbot_id is provided.
data.asset_idintegerUnique identifier of the uploaded file asset. Returned when the file is linked with a chatbot.
data.statusstringCurrent upload or linking status. Example values: Uploaded, Processing, Linked, Failed.
data.asset_urlstringURL of the uploaded file asset. Returned when the file is uploaded without chatbot linking.

Error Responses#

400 Bad Request#

Returned when the request is invalid, the file is missing, the file size exceeds the limit, or the uploaded file type is not supported.
{
  "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."
  }
}

401 Unauthorized#

Returned when the request does not include a valid bearer token.
{
  "message": "Unauthorized",
  "error": {
    "code": "UNAUTHORIZED",
    "detail": "Authentication token is missing or invalid."
  }
}

403 Forbidden#

Returned when the authenticated user does not have permission to upload files to the specified project or chatbot.
{
  "message": "Forbidden",
  "error": {
    "code": "FORBIDDEN",
    "detail": "You do not have permission to upload or link files for this project."
  }
}

404 Not Found#

Returned when the project or chatbot does not exist.
{
  "message": "Not Found",
  "error": {
    "code": "CHATBOT_NOT_FOUND",
    "detail": "Project or chatbot not found."
  }
}

500 Internal Server Error#

Returned when an unexpected error occurs while uploading or linking the file.
{
  "message": "Internal Server Error",
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "detail": "Something went wrong. Please try again later."
  }
}

Notes#

The request must be sent as multipart/form-data.
The file field is required.
Maximum file size is 10 MB.
Supported file types are: PDF, DOCX, DOC, XLS, XLSX, TXT, HTML, MD, Markdown, and JSON.
The chatbot_id field is optional.
If chatbot_id is provided, the uploaded file will be linked with the chatbot and processed as a knowledge asset.
If chatbot_id is not provided, the file will only be uploaded and the API will return asset_url.
File processing may take some time before the chatbot can use the uploaded knowledge.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Body Params multipart/form-dataRequired

Responses

🟢200
application/json
OK
Body

🟠401
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://agents.robofy.ai/v1/ai-agent/link_file/' \
--header 'Authorization: Bearer <token>' \
--form 'chatbot_id=""' \
--form 'file=@""' \
--form 'metadata=""'
Response Response Example
200 - Success
{
    "message": "Chatbot asset linkage initiated.",
    "data": {
        "linkage_id": 6548,
        "chatbot_id": "DKDvwn...",
        "asset_id": 5782,
        "status": "Processing"
    }
}
Modified at 2026-05-15 06:44:03
Previous
Add Text Content
Next
Stats
Built with