POST /message/logged-in
application/json

Body Required

  • prompt string Required

    The user's chat message/prompt.

  • stream boolean

    Whether to receive the response as a stream (Server-Sent Events).

    Default value is false.

  • chatId string Required

    The CUID of the chat session.

Responses

  • 200 application/json

    Chat response received (non-streaming)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
    • data object Required
      Hide data attribute Show data attribute object
      • response string Required

        The AI's response message.

  • 400 application/json

    Bad Request (e.g., missing prompt or chatId)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 403 application/json

    Forbidden (User does not have access to this chat)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 404 application/json

    Not Found (Chat session not found)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 200_stream text/event-stream

    Chat response streamed successfully (SSE)

    Server-Sent Events stream. Final message is 'data: [DONE]\n\n'.

POST /message/logged-in
curl \
 --request POST 'https://referspecs-backend.onrender.com/api/v1/message/logged-in' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"chatId":"clvxyz...","prompt":"What was the last thing I asked?","stream":true}'
Request example
{
  "chatId": "clvxyz...",
  "prompt": "What was the last thing I asked?",
  "stream": true
}
Response examples (200)
{
  "success": true,
  "statusCode": 200,
  "message": "string",
  "data": {
    "response": "string"
  }
}
Response examples (400)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (401)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (403)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (404)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (500)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}