Skip to content

Create an image-recognition session ​

POST/session-records/sessions

Creates an image-recognition session. The session is bound to pet_profile_id, sub_module_type, lang and the first image asset, and those cannot be changed afterwards.

Request URL ​

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

Request headers ​

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

Request body ​

json
{
  "module_type": 5,
  "pet_profile_id": 44,
  "sub_module_type": 6,
  "lang": "en-US",
  "trace_id": "pic-demo-20260914-0001"
}

Request fields ​

FieldTypeRequiredDescription
module_typeintegerYesAlways 5 for image recognition.
pet_profile_idintegerYesNumeric pet-profile ID.
sub_module_typeintegerNoImage-recognition subtype: 1 breed, 2 expression, 3 oral/dental, 4 faeces, 5 vomit, 6 skin, 7 ear canal, 8 eye. The schema allows omitting it, but the later image steps require the value locked into the session, so send it in practice; it cannot be changed after creation.
langstringNoSession language; defaults to zh-CN.
trace_idstringNoClient trace identifier.
contentstring/nullNoNormally omitted for image recognition.

Response example ​

json
{
  "code": 200,
  "message": "success",
  "data": {
    "session_id": "pic_<SESSION_ID>",
    "medical_record_id": 10001,
    "medical_record": {
      "id": 10001,
      "created_at": "2026-09-14T10:00:00+08:00",
      "updated_at": "2026-09-14T10:00:00+08:00",
      "session_id": "pic_<SESSION_ID>",
      "user_uuid": "<USER_UUID>",
      "pet_profile_id": 44,
      "module_type": 5,
      "sub_module_type": 6,
      "stage": null,
      "status": 2,
      "is_paid": 0,
      "is_del": 0,
      "report_status": 0,
      "image_recognition_status": 0,
      "report_type": "v1",
      "lang": "en-US",
      "summary": null,
      "report_url": null,
      "report_time": null,
      "trace_id": "pic-demo-20260914-0001"
    },
    "initial_message": null
  }
}

Response fields ​

FieldTypeDescription
session_idstringImage-recognition session ID; the core credential for all later steps.
medical_record_idinteger/nullMain AI record ID.
medical_recordobject/nullCreated AI record. See full report fields.
medical_record.idintegerRecord primary key.
medical_record.pet_profile_idintegerBound pet-profile ID.
medical_record.module_typeinteger5 for image recognition.
medical_record.statusintegerBusiness status; 2 means active.
medical_record.langstringLanguage locked into this session.
medical_record.created_at / updated_atstringRecord creation and update time (UTC+8, no offset).
initial_messageobject/nullFirst message when content is supplied; null in this example because content was omitted.

Common errors ​

HTTP / codemessageTrigger
400缺少宠物档案IDpet_profile_id was not sent.
400语言尚未启用: <lang>lang is not enabled in this environment; call GET /locales first.
400不支持的AI模块类型module_type is not 5.
最近更新

Qijie Open Platform · API Documentation