Workflow Overview
The clinical documentation workflow consists of three main stages:- Create Transcription - Store raw audio-to-text transcription from patient-doctor conversations
- Create Thread & Execute Runs - Process transcriptions with AI to extract clinical information
- Update Clinical Notes - Store and manage AI-generated clinical documentation
1. Create Transcription
Endpoint
Purpose
Creates a new transcription record for audio-to-text conversion from patient-doctor conversations. This is the first step in the clinical documentation workflow - stores the raw transcription before AI processing.Required headers
Optional headers
Request body
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
duration_seconds | number | Yes | Duration of the recording in seconds (min: 0) |
original_transcript | string | Yes | The transcribed text from the conversation |
language_used | string | No | Language code (e.g., ‘en’, ‘es’, ‘fr’) |
Success response (HTTP 201)
Example - Python
Example - JavaScript
2. Create Conversation Thread
Endpoint
Purpose
Creates a new conversation thread for AI-powered interactions (chat or clinical extraction). Initializes a stateful conversation session with the AI assistant. The thread maintains context across multiple interactions and is required before executing any conversation runs.Required headers
Optional headers
Request body
No request body required (empty POST).Success response (HTTP 201)
Example - Python
Example - JavaScript
3. Execute Conversation Run
Endpoint
Purpose
Executes a conversation run within an existing thread to process AI interactions. This is the core AI processing endpoint - sends messages to the AI assistant and initiates processing. Used for both real-time chat interactions and clinical note extraction from transcriptions. The run executes asynchronously and can be monitored via the join endpoint.Required headers
Optional headers
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
threadId | string | Yes | The thread identifier to execute the run in |
Request body
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
input.messages | array | Yes | Array of conversation messages |
input.messages[].role | string | Yes | Role of message sender (user, assistant, system) |
input.messages[].content | string | Yes | Message content |
config.configurable.thread_id | string | Yes | Thread identifier for this run |
Success response (HTTP 201)
Example - Clinical extraction
Example - Chat interaction
4. Update Clinical Note
Endpoint
Purpose
Updates an existing clinical note with AI-generated content, feedback, or metadata. Used to store AI-generated clinical documentation, link to conversation threads, and capture user feedback for quality improvement.Required headers
Optional headers
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | The clinical note UUID |
Request body
All fields are optional - update only what’s needed:Request fields
| Field | Type | Required | Description |
|---|---|---|---|
template | string | No | Clinical note format (SOAP, BIRP, DAP, GIRP) |
ai_generated_content | object | No | Structured clinical data (schema varies by template) |
feedback | string | No | User comments or feedback on the note |
report_thread_id | string | No | Thread ID that generated this content |
report_run_id | array | No | Array of run IDs involved in generating content |
Success response (HTTP 200)
Example - Python
Example - JavaScript
Complete Workflow Example
Here’s a complete example of the entire clinical documentation workflow:Python - Complete workflow
Supported Clinical Templates
Thetemplate field in clinical notes supports multiple formats:
SOAP (Subjective, Objective, Assessment, Plan)
BIRP (Behavior, Intervention, Response, Plan)
DAP (Data, Assessment, Plan)
Custom Templates
You can also use custom templates based on your organization’s requirements. Theai_generated_content field accepts any valid JSON object structure.
Error Handling
Common errors
| Code | Error | Description | Solution |
|---|---|---|---|
| 400 | Bad Request | Missing required fields or invalid data | Verify all required fields are provided |
| 401 | Unauthorized | Invalid or expired token | Check your Bearer token |
| 404 | Not Found | Thread or clinical note not found | Verify the ID exists |
| 500 | Internal Server Error | Server error | Retry with exponential backoff |
Error response format
Next steps
View Codify API
ICD-10 medical coding API
Error handling
Error responses and retry strategies
Authentication
API authentication and headers
OpenAPI Reference
Complete API specification