Developers

Consultation documents

Retrieve long summaries, short summaries, and SOAP notes after consultation completion.

When a consultation completes, the stream emits ai_consultation.complete with stable IDs for its long summary, short summary, and SOAP note.

The API represents each of these documents as an artifact. This is the resource name used in the completion event and retrieval endpoint.

The event confirms consultation completion and identifies the artifacts. It does not guarantee that each artifact is ready to retrieve. A request can return 202 while generation continues.

event: ai_consultation.complete
data: {"type":"ai_consultation.complete","artifacts":{"longSummary":"art_01K6JGGM2G2DB4Y9KB9H9MJJ6Q","shortSummary":"art_01K6JGGP7Q4R8S2T5V7W9X1Y3","soapNote":"art_01K6JGGR9Z6B2C4D6F8H0J2K4M"}}

Store each ID with the chat and the user-scoped identity that received the event. Retrieve an artifact with:

GET /artifacts/{artifactId}/
Authorization: Bearer YOUR_ORGANIZATION_TOKEN
X-Doctronic-User-ID: USER_ID

Document types

Completion keyartifactTypeIntended representation
longSummarylong_summaryLong consultation summary
shortSummaryshort_summaryShort consultation summary
soapNotesoap_noteSOAP note

A ready response contains data.artifactId, data.artifactType, and data.content. The content object includes the originating chatId, createdAt, and a Markdown body.

Ready artifact response
{
  "code": "success",
  "message": "Request successful",
  "data": {
    "artifactType": "short_summary",
    "artifactId": "art_01K6JGGP7Q4R8S2T5V7W9X1Y3",
    "content": {
      "chatId": "chat-id-from-the-consultation",
      "createdAt": "2026-08-16T15:30:00Z",
      "body": "## Consultation summary\n\n..."
    }
  }
}

Artifact bodies contain the consultation document. They do not contain private model reasoning.

Handle generation state

Artifact generation can finish after the completion event. Handle each status explicitly:

StatusMeaningIntegration behavior
200The artifact is ready.Validate artifactType and render or store content.body.
202The artifact is still being generated.Retry later with bounded backoff.
404The artifact is absent or outside the organization or user scope.Stop polling and verify the stored identity mapping.
500Artifact generation failed permanently.Stop polling and enter the integration's failure path.

The contract does not specify a response body or retry delay for 202. Do not assume one is present. Choose a bounded polling policy with your Doctronic business or implementation contact.

Preserve scope and provenance

The artifact endpoint checks both the authenticated organization and the selected user. A missing artifact and an artifact outside that scope both return 404, preventing resource discovery across integrations.

Verify that data.content.chatId matches the chat associated with the completion event before attaching the artifact to a local record.

Render Markdown defensively

Treat content.body as untrusted Markdown at the presentation boundary. Use a renderer configured for your product, sanitize any generated HTML, and do not execute scripts or embedded content. Preserve the original artifact ID and timestamp separately from the rendered display.

On this page