Create a consultation report task
POST
/ai-doc/reportDetailed Report Fields & UI Mapping
For complete field definitions and UI block mapping (reviews, body map highlights, 3-stage treatments, vet orders), please refer to Report Fields & UI Mapping.
Request URL
text
POST https://open-api.habitaxx.com/v1/ms-ai-fast/ai-doc/reportRequest headers
http
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/jsonRequest body
json
{
"session_id": "<SESSION_ID>",
"report_type": 1
}Request fields
| Field | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Smart Consultation session ID. |
report_type | integer | No | Defaults to 1; allowed values are 1, 2, 3, 4, and 7. Submit once for a normal session flow. |
report_type values (report fragments):
report_type | Fragment |
|---|---|
1 | Review / chief-complaint recap |
2 | Diagnosis |
3 | Treatment advice |
4 | Veterinary instructions |
7 | Supplements |
The platform generates all of these fragments; report_type only affects the context of this task (1 includes the image-recognition result). Submit the report task once per session and read the fragments through report_contents[].report_index.
Response example
json
{
"code": 200,
"message": "success",
"data": {
"session_id": "<SESSION_ID>",
"report_id": 10001,
"task": {
"task_id": "<TASK_ID>",
"task_type": "ai_doc_report_generate",
"status": "pending",
"progress": 0,
"result_payload_json": null,
"error_code": null,
"started_at": null,
"finished_at": null,
"created_at": "2026-09-14T10:10:00+08:00",
"updated_at": "2026-09-14T10:10:00+08:00"
},
"analysis": null
}
}Response fields
| Field | Type | Description |
|---|---|---|
session_id | string | Smart Consultation session ID. |
report_id | integer/null | Report ID. |
task | object/null | Asynchronous report task. Use its task_id for status queries. |
task.task_id | string | Task ID. |
task.task_type | string | Task type; always ai_doc_report_generate for report tasks. |
task.status | string | pending, processing, retrying, succeeded, failed, or canceled. |
task.progress | integer | Usually from 0 to 100. |
task.result_payload_json | object/null | Public result summary; contains only report_type and gateway_request_id. |
task.error_code | integer/null | Task error code. |
task.started_at | string/null | Task start time (UTC, no timezone offset). |
task.finished_at | string/null | Task finish time (UTC, no timezone offset). |
task.created_at | string | Task creation time (UTC+8, no timezone offset). |
task.updated_at | string | Task update time (UTC+8, no timezone offset). |
analysis | object/null | Synchronous analysis result; normally null for a report task. |
Next step and polling
- When
task.task_idis present: poll with Query an asynchronous task every 4 seconds, with a 5-minute ceiling; oncestatusissucceeded, read the report with Retrieve a complete report. - When
taskisnull(the report was generated synchronously): do not poll; readreport_idfrom the same response, or callGET /medical-record?session_id=<SESSION_ID>. - On
failedorcanceled: resubmit with Retry a failed task instead of creating another report task for the same session.
Submit the report task once per session; do not submit one task per report_type.