For the complete documentation index, see llms.txt. This page is also available as Markdown.

Artifacts

Retrieve Scribe transcripts, follow asynchronous artifact generation, review visit checklists, and finalize clinical notes with version checks.

Artifacts belong to a provider-owned Scribe session. Every route below checks that the authenticated provider owns the session and requires scribe:sessions:read_own. Generation, note edits, checklist changes, and note finalization also require scribe:notes:rw_own.

Use your assigned Scribe deployment and credentials. For the full capture and review workflow, see Capture to Finalized Note.

Get Transcript

Get Transcript

get
Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
session_idstring · uuidRequired
get/v1/{workspace_id}/sessions/{session_id}/transcript
GET /v1/{workspace_id}/sessions/{session_id}/transcript HTTP/1.1
Accept: */*
{
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "segments": [
    {
      "speaker": "text",
      "text": "text",
      "start_ms": 1,
      "end_ms": 1
    }
  ]
}

workspace_id and session_id are UUIDs. The response contains session_id and an ordered segments array. Each segment has text, a nullable speaker, and integer start_ms and end_ms offsets from session start.

A missing or inaccessible session, or an unavailable transcript, returns 404. Temporary transcript retrieval failures return 503.

Get Note

Get Note

get
Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

Successful Response

application/json

Reload-safe note poller: artifact fields present only when generation_status == "ready".

generation_status == "empty" is the phase-147 terminal state for a session ended with zero usable transcript segments: no note was (or will be) generated, and no artifact fields are present.

generation_statusstring · enumRequiredPossible values:
writeback_statusstring · enumRequiredPossible values:
session_idstring · uuid · nullableOptional
typestring · max: 64 · nullableOptional
statusstring · enum · nullableOptionalPossible values:
bodystring · max: 1000000 · nullableOptionalDeprecated
versioninteger · min: 1 · nullableOptional
generated_atstring · date-time · nullableOptional
signed_atstring · date-time · nullableOptional
updated_atstring · date-time · nullableOptional
clinician_namestring · nullableOptional
get/v1/{workspace_id}/sessions/{session_id}/note
GET /v1/{workspace_id}/sessions/{session_id}/note HTTP/1.1
Accept: */*
{
  "generation_status": "ready",
  "writeback_status": "succeeded",
  "error": {
    "field": "text",
    "message": "text"
  },
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "type": "text",
  "status": "draft",
  "structured": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "version": 1,
  "generated_at": "2026-01-01T00:00:00.000Z",
  "signed_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "carry_forward_available": [
    {
      "amd_field_code": "text",
      "label": "text",
      "value": "text",
      "source_note_id": 1,
      "source_signed_at": "text"
    }
  ],
  "clinician_name": "text"
}

Read generation_status before displaying the note:

Value
Meaning
Client behavior

pending

Generation has not completed

Continue checking this endpoint; artifact fields can be null.

ready

The note is available

Display structured and retain version for subsequent edits or finalization.

failed

Generation failed

Show the failure state and use any returned error details.

empty

The session ended without usable transcript segments

Show that no note was generated; stop waiting for this generation.

When ready, the response includes session_id, type, status, structured, version, and generation, signing, and update timestamps. body is deprecated. The note's document status (draft, submitted, or voided) is separate from its generation_status.

EHR Writeback Fields

Every note read includes writeback_status, which reports whether the note has been written back to a configured EHR:

Value
Meaning

succeeded

The note was written back when it was finalized.

pending

EHR writeback is enabled for the workspace and the note has not been finalized yet.

disabled

EHR writeback is not enabled for the workspace. The note will not be written back.

not_attempted

Writeback is enabled, but the note was finalized (or ended with no note) without a writeback. It is not retried later.

Check writeback_status == "succeeded" when you only need to know whether the note reached the EHR. The other values separate workspace configuration from note history.

When EHR writeback is enabled and the session is linked to an EHR appointment with a supported note template, a ready note can also include:

  • carry_forward_available: the fields that have a value available to carry forward from the patient's last signed note. Each entry names the field code, an optional label, the carried display value, and the source note's identifier and signed date when the EHR attributes one. value is null when the EHR attributes no display value to the field. Treat value as chart content and handle it like the note body. Use these entries to show the provider what the EHR would carry while they edit the note.

  • clinician_name: the authoring clinician's display name as the EHR reports it. Treat it as display context, not as a readiness or writeback signal.

Both are best-effort. carry_forward_available is an empty list and clinician_name is null when writeback is disabled, the note is not linked to a supported EHR appointment, or the EHR lookup fails. A failed lookup does not fail the note read.

A session with no note-generation record returns 404; an artifact that is temporarily unavailable returns 503. Do not interpret every non-ready response as a missing session.

Generate a Note

Generate Note

post
Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Body
note_typestring · enum · nullableOptionalPossible values:
instructionsstring · max: 1200 · nullableOptional
Responses
200

An identical job already succeeded; the note is returned.

application/json
post/v1/{workspace_id}/sessions/{session_id}/note
POST /v1/{workspace_id}/sessions/{session_id}/note HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 54

{
  "note_type": "amd-psych-intake",
  "instructions": "text"
}
{
  "note": {
    "session_id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "text",
    "status": "draft",
    "structured": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "version": 1,
    "generated_at": "2026-01-01T00:00:00.000Z",
    "signed_at": "2026-01-01T00:00:00.000Z",
    "updated_at": "2026-01-01T00:00:00.000Z"
  },
  "generation": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "model_provider": "text",
    "model_name": "text",
    "prompt_version": "text",
    "generated_at": "2026-01-01T00:00:00.000Z"
  }
}

Generation requires a mutable session and an available, non-empty canonical transcript. A missing transcript returns 404; an empty transcript returns 409.

Request field
Contract

note_type

Optional compatibility selector; may be null. Accepts only the current note template identifiers. The session's pinned note template takes precedence.

instructions

Optional generation guidance, up to 1,200 characters; may be null.

Use the visit type and template selected on the session to establish the note format. Changing this request's note_type does not override a pinned session template.

A new or pending generation returns 202 with a generation envelope. If an identical generation has already succeeded, the route can return 200 with note and generation. Poll Get Note for the current result. A successful enqueue does not mean a draft is ready to display.

Save an Edited Note

Update Note

put

Versioned structured-note autosave with optimistic concurrency (design §4.2).

Accepts {base_version, structured} only: a complete structured-document replacement, validated as a full document against the pinned template (phase-71 registry) BEFORE the compare-and-set. The CAS on version means two racing writers with the same base_version yield exactly one success and one 409 version_conflict. Rejected once the session is terminal (append-only, 409 invalid_session_state). 404 when no note has been generated yet. An unsupported template is rejected with 422 unsupported_note_template; a missing or invalid structured document with 422 validation_error carrying per-field details.

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Body

Body of PUT /sessions/{id}/note — versioned structured-note autosave (design §4.2).

The write is a complete structured-document replacement: send the full structured envelope (every value) on each write, not a partial patch. base_version is the version the client last read; a stale value loses the compare-and-set and returns 409 version_conflict.

base_versioninteger · min: 1Required
Responses
200

Successful Response

application/json

200 body for a successful PUT /sessions/{id}/note: the new version + write time.

versioninteger · min: 1Required
updated_atstring · date-timeRequired
put/v1/{workspace_id}/sessions/{session_id}/note
PUT /v1/{workspace_id}/sessions/{session_id}/note HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 280

{
  "base_version": 1,
  "structured": {
    "schema_version": 1,
    "template_id": "text",
    "template_version": "text",
    "values": {
      "ANY_ADDITIONAL_PROPERTY": {
        "value": "text",
        "rationale": "text",
        "source": "scribe"
      }
    },
    "review": {
      "confirmed_sections": [
        "text"
      ],
      "acknowledgments": [
        "text"
      ],
      "amd_confirmed": false
    }
  }
}
{
  "version": 1,
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Read the current note, retain its version, and send that value as base_version with the complete structured document. This is a full document replacement, not a field patch. Preserve unchanged values and the pinned template; an autosave cannot switch templates. A successful save returns the new version and update time. Use that version for the next edit or finalization.

A stale version returns 409 version_conflict: reload and reconcile the provider’s edits before saving again. A terminal session rejects edits. A missing note returns 404, and an invalid or incompatible structured document returns 422 with validation details.

Use structured for all note edits. The note-update request no longer accepts a body field. A client generated from a schema or SDK published before September 25, 2026 can still offer a body-only edit; regenerate it or upgrade the SDK. The deprecated body field on a note response is a separate compatibility field and is always null.

Regenerate One Section

Regenerate Note Section

post

Regenerate a single section of the note as a new version (async ensure-semantics, phase 09).

Reuses the phase-08 note version for optimistic concurrency: a stale base_version (a manual edit or another regen landed since the client read) is rejected up front with 409 version_conflict, and the worker re-checks it under a compare-and-set at persist time so a race can never clobber a newer note. Enqueues an artifact_kind='note' job whose params carry section_id/base_version; the worker rewrites that section and persists base_version + 1. Returns 202 with the job envelope. Rejected once the session is terminal (409 invalid_session_state, post-finalize immutability).

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Body

Body of POST /sessions/{id}/note/regenerate-section (SPEC §6.1 P4).

Regenerates a single named section of the current note. base_version is the note version the client last read; a stale value returns 409 version_conflict (never clobbers a racing manual edit).

section_idstring · min: 1 · max: 128Required
instructionsstring · max: 1200 · nullableOptional
base_versioninteger · min: 1Required
Responses
202

Successful Response

application/json

202 body for an enqueued (or collapsed-onto-in-flight) generation job.

post/v1/{workspace_id}/sessions/{session_id}/note/regenerate-section
POST /v1/{workspace_id}/sessions/{session_id}/note/regenerate-section HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "section_id": "text",
  "instructions": "text",
  "base_version": 1
}
{
  "generation": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "artifact_kind": "note",
    "status": "pending"
  }
}

Regeneration uses the requested section, optional instructions, and the reviewed base_version. It is asynchronous: acceptance does not mean the revised note is ready. Version checks apply both when the request is accepted and when the result is saved, so concurrent edits can prevent the generated section from replacing a newer note. Read the resulting note and have the provider review it before finalizing.

Finalize a Note

Finalize Note

post

Server-authoritative finalize (SPEC §6.1 P4): atomically submit the note + complete the session.

Phase 178: finalize accepts ANY stored note shape — there is no note-content/structural validation gate. A note with missing required fields, no approved diagnosis, amd_confirmed=false, and/or a structurally-off document finalizes 200. The only non-validation mechanics still enforced are ownership/scope, base_version optimistic concurrency, already-submitted idempotency (200), and the atomic session completion. An already-submitted note is an idempotent 200. A terminal cancelled/failed session is 409 invalid_session_state and the note submit is rolled back with it (the two writes are one unit of work).

EHR writeback (ehr-note-writeback phase 07): with scribe.note-writeback-enabled on for the workspace, the note is POSTed to the EHR inside the same transaction, after the session completes and before commit. Any writeback failure is ehr_writeback_failed (500 when the request can't be built, 502 when the EHR call fails) and rolls both writes back (note stays draft); success commits a note_writebacks provenance row with them. The already-submitted short-circuit means a successful finalize never re-posts. A separate submit flag sets submitToAmd: off, the writeback is a dry run (stored + mapped by the EHR, not written to AMD).

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Body

Body of POST /sessions/{id}/note/finalize (V340).

base_version is the note version the provider is finalizing; a stale value returns 409 version_conflict. Server-side gate validation runs on the stored document, not the request, so a client cannot bypass required-field gates.

base_versioninteger · min: 1Required
Responses
200

Successful Response

application/json
writeback_statusstring · enumRequiredPossible values:
post/v1/{workspace_id}/sessions/{session_id}/note/finalize
POST /v1/{workspace_id}/sessions/{session_id}/note/finalize HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "base_version": 1
}
{
  "note": {
    "session_id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "text",
    "status": "draft",
    "structured": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "version": 1,
    "generated_at": "2026-01-01T00:00:00.000Z",
    "signed_at": "2026-01-01T00:00:00.000Z",
    "updated_at": "2026-01-01T00:00:00.000Z"
  },
  "writeback_status": "succeeded",
  "field_dispositions": [
    {
      "amd_field_code": "text",
      "label": "text",
      "disposition": "written",
      "reason": "written_from_transcript",
      "source": "transcript",
      "source_note_id": 1,
      "source_signed_at": "text",
      "source_template_name": "text",
      "display_value": "text"
    }
  ]
}

Finalization requires a JSON body containing the positive integer base_version of the note the provider reviewed. Read that version from Get Note; the value below is illustrative.

On success, the response wraps the submitted note in note and includes the note's writeback_status. Submission sets signed_at and completes the session atomically. An already submitted note is an idempotent success.

When EHR writeback is enabled for the workspace, finalization writes the note to the EHR as part of the same operation. If the writeback fails, the whole finalize is rolled back: the note stays a draft, the session is not completed, and the route returns ehr_writeback_failed with a reason entry in details:

Status
Reasons
What to do

500

provider_email_missing, appointment_link_missing, unsupported_note

The note could not be prepared for the EHR. Fix the provider account, appointment link, or note template before retrying.

502

ehr_rejected, ehr_unavailable, chart_note_failed, chart_note_not_written

The EHR call failed. An ehr_message entry can carry the EHR's own error text. Retry after the cause clears, using the current base_version.

Because nothing was committed, a retry can succeed without reloading, unless the note changed in the meantime.

The finalize response also includes field_dispositions, a per-field summary of how the writeback handled each known field of the note template. Each entry carries the field code, an optional label, a disposition of written or omitted, a reason, and an optional source:

reason

Meaning

written_from_transcript

Written from the note drafted from the visit transcript.

written_from_clinician_edit

Written because the provider edited this field. The edit is sent even when the EHR has a value to carry forward.

written_session_meta

Written from per-visit session details, such as times and dates of service.

omitted_carried_forward

Not sent because the provider did not edit the field and the EHR carries the value forward from a prior signed note.

omitted_identity_autowritten

Not sent because the EHR writes this identity field itself.

omitted_empty_no_value

Not sent because the carried-forward field had no value.

not_populated

A known template field that this writeback did not fill.

A field the provider edits takes precedence over a carried value: it is written with source set to clinician_edit. A field the provider leaves untouched steps aside so the EHR carries its prior value. Carried-forward entries name the source note in source_note_id, source_signed_at, and source_template_name. Carried-forward and EHR identity entries include the value the EHR uses in display_value. Written and not-populated entries leave it out, because written values are already in the note. Treat display_value as chart content and handle it like the note body. The array is empty when EHR writeback is not enabled, and on an idempotent re-finalize of an already submitted note.

For an unsubmitted note, a stale version returns 409 version_conflict: reload the current note and have the provider review it before trying again. A missing note returns 404; a cancelled or failed session returns 409 invalid_session_state.

Finalization checks the version but can submit a note with missing clinical fields. The provider must review its completeness and correctness before submission.

Session Summary

Generate Summary

post
Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

An identical job already succeeded; the summary is returned.

application/json
post/v1/{workspace_id}/sessions/{session_id}/summary
POST /v1/{workspace_id}/sessions/{session_id}/summary HTTP/1.1
Accept: */*
{
  "summary": {
    "session_id": "123e4567-e89b-12d3-a456-426614174000",
    "summary": "text",
    "generated_at": "2026-01-01T00:00:00.000Z",
    "updated_at": "2026-01-01T00:00:00.000Z"
  },
  "generation": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "model_provider": "text",
    "model_name": "text",
    "prompt_version": "text",
    "generated_at": "2026-01-01T00:00:00.000Z"
  }
}

Get Summary

get
Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
generation_statusstring · enumRequiredPossible values:
session_idstring · uuid · nullableOptional
summarystring · max: 10000 · nullableOptional
generated_atstring · date-time · nullableOptional
updated_atstring · date-time · nullableOptional
get/v1/{workspace_id}/sessions/{session_id}/summary
GET /v1/{workspace_id}/sessions/{session_id}/summary HTTP/1.1
Accept: */*
{
  "generation_status": "ready",
  "error": {
    "field": "text",
    "message": "text"
  },
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "summary": "text",
  "generated_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

The POST generates a summary from the session transcript and available note. It requires a mutable session and a non-empty transcript. Like note generation, it returns 202 while work is pending or 200 with summary and generation when an identical completed result can be reused.

The GET returns generation_status (ready, pending, or failed). When ready, it also returns the summary text, session_id, generated_at, and updated_at; those artifact fields may be null while pending or failed. No generation record returns 404.

Session Checklist

A session's visit type supplies its checklist. Clients read and update those existing items; they do not submit an arbitrary checklist for generation. The former checklist-generation POST is no longer part of the current contract.

Get Checklist

get

Read the session's checklist.

The checklist is instantiated from the session's visit type when the session is created and is the authoritative source of its items, so this returns them from the first frame — including before any transcript exists. Persisted per-item manual and auto toggle state is overlaid on the items. Returns 404 when the session has no checklist.

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
generation_statusstring · enumRequiredPossible values:
session_idstring · uuid · nullableOptional
titlestring · max: 256 · nullableOptional
statusstring · enum · nullableOptionalPossible values:
created_atstring · date-time · nullableOptional
updated_atstring · date-time · nullableOptional
get/v1/{workspace_id}/sessions/{session_id}/checklist
GET /v1/{workspace_id}/sessions/{session_id}/checklist HTTP/1.1
Accept: */*
{
  "generation_status": "ready",
  "error": {
    "field": "text",
    "message": "text"
  },
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "title": "text",
  "status": "open",
  "items": [
    {
      "id": "text",
      "label": "text",
      "category": "text",
      "state": "open",
      "evidence": "text",
      "source": "manual",
      "updated_by": "123e4567-e89b-12d3-a456-426614174000",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

A checklist can be available before a transcript exists. A successful read includes generation_status: "ready", the checklist title and status, and items with id, label, category, state, and optional evidence and provenance. Effective item state is open or checked. A session with no checklist returns 404.

Update Checklist

patch

Merge manual per-item toggles into the checklist state, each provenanced (who/when, source).

Requires a generated checklist (404 otherwise); every toggled id must belong to it (422 per-field otherwise). Toggles are idempotent upserts, re-toggleable until finalize; 409 invalid_session_state once the session is terminal. Auto-check state (phase 09) is written server-side, never here.

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Body

Body of PATCH /sessions/{id}/checklist (V340): manual per-item toggles.

Responses
200

Successful Response

application/json

Response of PATCH /sessions/{id}/checklist: the generated checklist with per-item manual state + provenance overlaid, and status recomputed from the effective item states.

session_idstring · uuidRequired
titlestring · max: 256Required
statusstring · enumRequiredPossible values:
updated_atstring · date-timeRequired
patch/v1/{workspace_id}/sessions/{session_id}/checklist
PATCH /v1/{workspace_id}/sessions/{session_id}/checklist HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "items": [
    {
      "id": "text",
      "completed": true,
      "source": "manual"
    }
  ]
}
{
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "title": "text",
  "status": "open",
  "items": [
    {
      "id": "text",
      "label": "text",
      "category": "text",
      "state": "open",
      "evidence": "text",
      "source": "manual",
      "updated_by": "123e4567-e89b-12d3-a456-426614174000",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit 1-100 toggles using IDs returned by the GET. completed is required; source, when supplied, must be manual.

The example ID must be replaced with one from the session's checklist. The response is the effective checklist, with item provenance and a recomputed status. An unknown item ID returns 422, a missing checklist returns 404, and a terminal session returns 409 invalid_session_state.

Auto Check Checklist

post

LLM auto-check of the generated checklist against the (partial) transcript mid-session (phase 09).

Evaluates each generated checklist item against the best-available transcript and returns a per-item matched verdict; matched items are persisted as source='auto' checklist state that COEXISTS with manual PATCH /checklist toggles — the upsert preserves any manually-decided item and never clobbers it. No generated checklist yet (or no transcript) → an empty {matches:[]}.

No-op guard (phase 88): the handler hashes the auto-check input (selected transcript + checklist items) and compares it to the last-checked hash stored on the session. An unchanged input short-circuits — no LLM call, no upsert — and returns the already-persisted source='auto' state; a changed (or first) input runs the LLM as before and then, under the session row lock, persists both the matched items and the new hash. This keeps a redundant re-check (client double-fire, reconnect, or a fire ahead of a fresher server snapshot) cheap regardless of the client's cadence.

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

Successful Response

application/json

200 body of POST /sessions/{id}/checklist/auto-check: the LLM's per-item match verdict.

Matched items are also persisted server-side as source='auto' checklist state (coexisting with, and never clobbering, manual PATCH /checklist toggles).

post/v1/{workspace_id}/sessions/{session_id}/checklist/auto-check
POST /v1/{workspace_id}/sessions/{session_id}/checklist/auto-check HTTP/1.1
Accept: */*
{
  "matches": [
    {
      "item_id": "text",
      "category": "text",
      "matched": true,
      "evidence": "text"
    }
  ]
}

Auto-check evaluates the checklist against the available canonical or partial transcript and returns per-item matches. It preserves manually decided items. If there is no checklist or usable transcript, the response can contain an empty matches array; that does not mean the checklist has been satisfied.

Get Codes

Get Codes

get

Reload-safe read of the session's ICD codes (phase 130: session-scoped, not generation-anchored).

Returns EVERY code owned by the caller on this session — both AI suggestions and provider-authored rows — so provider codes are visible and the read no longer 404s when no codes generation ever ran. generation_status is advisory metadata about the AI generation only (ready when none ran or it succeeded, pending while running, failed with its error): the items are authoritative regardless.

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
generation_statusstring · enumRequiredPossible values:
session_idstring · uuid · nullableOptional
get/v1/{workspace_id}/sessions/{session_id}/codes
GET /v1/{workspace_id}/sessions/{session_id}/codes HTTP/1.1
Accept: */*
{
  "generation_status": "ready",
  "error": {
    "field": "text",
    "message": "text"
  },
  "session_id": "123e4567-e89b-12d3-a456-426614174000",
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "code": "text",
      "description": "text",
      "rationale": "text",
      "confidence": 1,
      "decision": "approved",
      "source": "ai"
    }
  ]
}

Returns the session's code suggestions and provider-authored codes in items. Each item includes id, code, description, rationale, an optional confidence, a decision, and a source. Treat these items as the current code list even while AI generation is pending or failed.

generation_status describes AI generation separately: ready when none has run or it has succeeded, pending while running, or failed with error information. An empty code list is valid. decision is null until the provider decides, then approved or rejected. source is ai for a generated suggestion or provider for a code the provider added. A confidence value is not an approval.

Generate Codes

post

Enqueue ICD-10-CM code-suggestion generation for an owned session (explicit regenerate).

Async ensure-semantics: derives the idempotency identity from the canonical transcript + latest note (no request body), then idempotently enqueues a scribe.generations job (artifact_kind='codes'). The worker prompts the model, parses strict-JSON suggestions, and persists one scribe.icd_suggestions row per code (an empty extraction is treated as a failed generation). Returns 202 with the job envelope, or 200 with the codes if an identical job already succeeded. Codes are also auto-enqueued server-side when the note job succeeds.

Path parameters
workspace_idstring · uuidRequired
session_idstring · uuidRequired
Responses
200

An identical job already succeeded; the codes are returned.

application/json
post/v1/{workspace_id}/sessions/{session_id}/codes
POST /v1/{workspace_id}/sessions/{session_id}/codes HTTP/1.1
Accept: */*
{
  "codes": {
    "session_id": "123e4567-e89b-12d3-a456-426614174000",
    "items": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "code": "text",
        "description": "text",
        "rationale": "text",
        "confidence": 1,
        "decision": "approved",
        "source": "ai"
      }
    ]
  },
  "generation": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "model_provider": "text",
    "model_name": "text",
    "prompt_version": "text",
    "generated_at": "2026-01-01T00:00:00.000Z"
  }
}

Explicit code generation requires a mutable session and a non-empty transcript. It follows the same 202 pending or 200 reused-result pattern as summary generation. Read the GET endpoint for the current code list and generation state.

Last updated

Was this helpful?