How generation works
Generation is a backend-run flow.- List templates with
GET /templates. - Fetch the template you want with
GET /templates/{template_id}. - Collect the
note_idvalues you want to use. - Call
POST /clients/{client_id}/reports/generateand store the returnedjob_id. - Poll
GET /jobs/{job_id}until the job completes. - Fetch the saved report from
/clients/{client_id}/documents/{report_id}.
Request body
note_ids must belong to the same client and be visible to the API key you used.
Job lifecycle
The generation endpoint returns JSON immediately:GET /jobs/{job_id} until the job reaches a terminal state.
Possible statuses are:
queuedin_progresscompletedfailed
Fetch the generated report
After the job iscompleted, fetch the report by ID:
format=markdown or format=html.