Generate a clinical note
Writes the consultation's clinical note with AI and saves it as the current version of the record (changeType: generated in version history).
First transcribes any uploaded recordings that have not been transcribed yet and waits for every recording on the consultation to finish (up to 10 minutes). Generation then uses the full transcript, the consultation's additional info and uploaded files, the selected template, the linked patient's details and earlier visits, the clinic-wide and personal writing instructions, the user's learned writing style, and the recording language. Generation itself usually takes well under a minute.
Synchronous (default): the request blocks until the note is saved and returns it in clinicalNote. If the consultation's clinical note uses a structured template, the response is message: "Structured document generation initiated" and the note is generated in the background; poll the consultation until isGeneratingClinicalNote is false, then read the record. A consultation with no transcript returns 400.
Callback (callbackUrl set): returns at once; the note or the error (including an empty transcript) is POSTed to the callback URL. Use it to avoid holding a connection open. Both modes share a 10-minute limit for the whole job, transcription wait included; a job cut off by that limit returns a gateway timeout in synchronous mode and sends no callback at all in callback mode.
Side effects: the consultation's selected template is updated when templateId is given, the consultation's AI title may be refreshed, and the consultation is marked as submitted. Not idempotent: every call runs the AI model again and adds a version. Requires a personal API key and write access to the consultation; archived consultations return 403.
Request
- Base URLhttps://vetnio.com/api/v2
- URLhttps://vetnio.com/api/v2/workspaces/{workspaceId}/consultations/{consultationId}/clinical-note/generate
- AuthHTTP bearer
Path parameters
Identifier of the clinic (workspace), as returned by GET /workspaces. The key's user must be a member of the clinic, or an admin of the organization it belongs to.
Identifier of the consultation (UUID), as returned when it was created or by GET /workspaces/{workspaceId}/consultations. It must belong to the clinic in workspaceId.
Request body
Example request
{
"templateId": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f9a6c13",
"callbackUrl": "https://pms.example.com/webhooks/vetnio/clinical-note?token=9f2c7e"
}Response
Synchronous free-text generation: the saved note in clinicalNote. Callback mode or structured-template notes: a status message.
Example response
{
"message": "Callback URL has been queued",
"clinicalNote": "<strong>History</strong><br />Bella, an 8-year-old Labrador, has had intermittent left hind lameness for 2 weeks.<br /><br /><strong>Examination</strong><br />• T 38.6 °C<br />• Mild pain on extension of the left stifle<br /><br /><strong>Plan</strong><br />• Carprofen 2 mg/kg PO q12h for 7 days<br />• Recheck in 14 days"
}Changes
No recorded changes to this operation across all 1 revision of this API.