Skip to content

Save the user's answer ​

POST/session-records/messages

Saves the user's answer for one Q&A round. Image messages and model messages used for replay go through the same endpoint.

Request URL ​

text
POST https://open-api.habitaxx.com/v1/ms-ai-fast/session-records/messages

Request headers ​

http
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json

Request fields ​

FieldTypeRequiredDescription
session_idstringYesSession ID.
rolestringYesuser, assistant, or system; any other value returns 400.
contentstringYesThe user's answer text; a JSON string is also accepted.
module_typeintegerNo1 for Smart Consultation, 5 for image recognition; when omitted it is derived from the session record.
content_typeintegerNo1 text (default), 2 image, 3 JSON.
stageintegerNoBusiness stage; consultation answers normally send 2.
parent_sessionstring/nullNoParent session ID.
imagestring/nullNoImage URL for image messages; use the exact url returned by /oss/images.
extra_jsonobject/nullNoExtended payload.
is_hiddenintegerNoWhether the message is hidden; defaults to 0.

Request body: text answer ​

json
{
  "session_id": "<SESSION_ID>",
  "role": "user",
  "content": "最近没有更换食物。",
  "module_type": 1,
  "content_type": 1,
  "stage": 2
}

Request body: image message ​

json
{
  "session_id": "<SESSION_ID>",
  "role": "user",
  "content": "用户补充了一张图片",
  "module_type": 1,
  "content_type": 2,
  "image": "<UPLOAD_RESPONSE_DATA_URL>"
}

Response example ​

json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 2,
    "created_at": "2026-09-14T10:05:00+08:00",
    "updated_at": "2026-09-14T10:05:00+08:00",
    "session_id": "<SESSION_ID>",
    "user_uuid": "<USER_UUID>",
    "module_type": 1,
    "role": "user",
    "content": "最近没有更换食物。",
    "content_type": 1,
    "stage": 2,
    "parent_session": null,
    "image": null,
    "evaluation": null,
    "extra_json": null,
    "is_hidden": 0
  }
}

Response fields ​

FieldTypeDescription
idintegerMessage ID.
session_idstringSession ID.
rolestringuser, assistant, or system.
contentstringMessage text or a JSON string.
content_typeinteger1 text, 2 image, 3 JSON.
module_typeinteger1 consultation, 5 image recognition.
stageinteger/nullBusiness stage.
parent_sessionstring/nullParent session ID.
imagestring/nullImage URL for image messages.
extra_jsonobject/nullExtended payload.
is_hiddenintegerWhether the message is hidden: 0 no, 1 yes.
evaluationobject/nullEvaluation payload; null when not evaluated.
created_at / updated_atdatetimeCreation and update time.
user_uuidstringPlatform-internal user identifier; do not use externally.

Common errors ​

HTTP / codemessageTrigger
400role 仅支持 user/assistant/systemrole has any other value.
404会话不存在session_id does not exist or belongs to another user.
422Field requiredsession_id, role, or content is missing.

Notes ​

最近更新

Qijie Open Platform · API Documentation