Robofy API
HomeChangelog
HomeChangelog
Visit Website
Sign In
Create an account
  1. Chat
  • Start Guide
    • Overview
    • Architecture
    • Authentication
    • Changelog
  • Robofy API
    • Chat
      • Generate Client Token (Handshake)
        POST
      • Send Message (Streaming)
        POST
      • Send Message (Non Streaming)
        POST
      • Send WhatsApp Message
        POST
    • 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
      • Get Crawl Status
      • Add Text Content
      • Add File
    • 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. Chat

Send Message (Non Streaming)

POST
/v1/ai-agent/chat
Send Message (Non Streaming) allows a client application to send a user message to an AI agent and receive a complete AI-generated response in a single request.
This endpoint is designed for chat interfaces, web chat widgets, support bots, messaging integrations, customer support automation, lead qualification bots, and internal knowledge assistants.
The client sends the user query along with the project ID, chatbot ID, and user-specific context. The AI agent processes the request and returns a response based on the chatbot configuration, knowledge base, conversation context, and available tools.

Endpoint#


Request Body#

{
  "query": "Hello",
  "pid": "3..",
  "chatbot_id": "DKDvwn...",
  "user_context": {
    "session_id": "6ff922ed-9884-4430-83c9-7ac83a7b0574",
    "platform": "web"
  }
}

Request Parameters#

FieldTypeRequiredDescription
querystringYesUser message or question sent to the chatbot.
pidstringYesProject ID associated with the chatbot.
chatbot_idstringYesUnique chatbot identifier that should process the message.
user_contextobjectYesAdditional context about the user, session, channel, or client application.
user_context.session_idstringNoUnique session identifier used to continue or group messages in the same conversation.
user_context.platformstringYesPlatform or channel where the message originated. Example: web.

Success Response#

{
  "message": "Success",
  "data": {
    "answer": "Hello! How can I help you with your setup today?",
    "session_id": "6ff922ed-9884-4430-83c9-7ac83a7b0574"
  }
}

Response Fields#

Root#

FieldTypeDescription
messagestringStatus message for the chat request.
dataobjectContains the AI-generated response and conversation session details.

data#

FieldTypeDescription
answerstringAI-generated response returned by the chatbot.
session_idstringConversation session identifier associated with the response.

Error Responses#

400 Bad Request#

Returned when the request body is invalid or required fields are missing.
{
  "message": "Bad Request",
  "error": {
    "code": "BAD_REQUEST",
    "detail": "Invalid request body or missing required fields."
  }
}

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."
  }
}

Notes#

Use this endpoint when you want the full response returned at once.
For real-time typing effects or token-by-token responses, use the streaming message API instead.
Pass the same session_id in user_context to continue an existing conversation.
If session_id is not provided, your backend may generate or assign a new session depending on implementation.
The chatbot_id must belong to the specified project ID.
The response may depend on the chatbot’s knowledge base, linked assets, configured prompts, tools, and conversation history.

Request

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

Examples

Responses

🟢200Success
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://agents.robofy.ai/v1/ai-agent/chat' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "query": "Hello",
    "pid": "3..",
    "chatbot_id": "DKDvwn...",
    "user_context": {
        "session_id": "6ff922ed-9884-4430-83c9-7ac83a7b0574",
        "platfrom": "web"
    }
}'
Response Response Example
200 - Success
{
    "message": "Success",
    "data": {
        "answer": "Hello! How can I help you with your setup today?",
        "session_id": "6ff922ed-9884-4430-83c9-7ac83a7b0574"
    }
}
Modified at 2026-05-04 11:21:02
Previous
Send Message (Streaming)
Next
Send WhatsApp Message
Built with