Send message.
Changed onSends a user message to an agent and returns the agent's response. Supports streaming for real-time display, file attachments for document analysis, and persona overrides for dynamic behavior. This is the primary endpoint for chat interactions.
Notes: Add ?stream=true to receive the response in real-time chunks.
Request
- Base URLhttps://app.customgpt.ai
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The ID of the agent to get the messages for
The session ID of the converstaions to get the messages for
Query parameters
When true, the response is sent as a stream of data-only server-sent events (SSE) as tokens are generated, terminated by a status: "finish" event. When false, the full response is returned in a single JSON object. See the streaming guide for client implementation examples.
The ISO 639-1 language code for the response language. Examples: es - Spanish, fr - French, de - German, ja - Japanese. The agent will attempt to respond in this language regardless of the query language.
The external ID of the prompt history.
Request body multipart/form-data
Example request
{
"prompt": "How do I reset my password?",
"stream": false
}Response
Send a message to a conversation
Example response
{
"status": "success",
"data": {
"id": 101,
"conversation_id": 42,
"user_id": 1,
"user_query": "What file formats does CustomGPT support?",
"openai_response": "CustomGPT supports PDF, DOCX, TXT, and more. You can also ingest content via sitemap, URL, or file upload.",
"citations": [
3,
7
],
"citations_external": [
{
"source_id": "1-1",
"type": "web",
"action": "web_search",
"title": "Paris - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Paris",
"description": "Paris is the capital of France."
}
],
"citations_hidden": [
12
],
"tools": [],
"metadata": {
"user_ip": "203.0.113.12",
"user_agent": "Mozilla/5.0",
"external_id": "ext_id_abc123",
"request_source": "web"
},
"response_feedback": {
"created_at": "2024-08-27T21:07:20.000000Z",
"updated_at": "2024-08-27T21:07:20.000000Z",
"user_id": 1,
"reaction": "liked"
},
"customer_intelligence": {
"prompt_id": 101,
"conversation_id": 42,
"project_id": 7,
"user_query": "What file formats does CustomGPT support?",
"ai_response": "CustomGPT supports PDF, DOCX, TXT, and more.",
"created_at": "2026-02-01T09:20:00.000000Z",
"content_source": "in-context",
"user_emotion": "neutral",
"user_intent": "informational",
"language": "en",
"human_request": "false",
"user_id": -2,
"user_location": "US",
"chatbot_deployment": "web",
"risk_fidelity": "Good",
"risk_jailbreak": "no_event",
"risk_prompt_leakage": "no_event",
"risk_profanity": "no_event",
"accuracy": "-",
"stakeholder_status": "UNKNOWN",
"browser": "Chrome 121"
},
"created_at": "2026-02-01T09:20:00.000000Z",
"updated_at": "2026-02-01T09:20:05.000000Z"
}
}Changes
- breaking
removed the media type
application/jsonfrom the request body - breaking
the response property
/became nullable for the status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
422.00enum value to the/response property for the response status - warning
added the new
dislikedenum value to the//response property for the response status - warning
added the new
likedenum value to the//response property for the response status - warning
added the new
neutralenum value to the//response property for the response status - info
added the media type
multipart/form-datato the request body - info
added the non-success response with the status
- info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
removed the
neutraldislikedlikedenum value from the//response property for the response status
- breaking
- warning
added the new
Agent id is requiredenum value to the/response property for the response status - warning
added the new
Agent with id {projectId} not foundenum value to the/response property for the response status - info
added the new optional
queryrequest parameterexternal_id - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the non-success response with the status
- info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
/to the response with the status - info
removed the
Project id is requiredenum value from the/response property for the response status - info
removed the
Project with id {projectId} not foundenum value from the/response property for the response status
- warning