Skip to main content
The Codify API provides AI-powered ICD-10 medical coding services. It processes clinical notes or PDF files and returns structured medical coding assessments with confidence scores and justifications.

Request structure

Endpoint

Required headers

Optional headers

Request body structure

The medical_note field is required. You can optionally include a pdf_file for additional context:

Required: Text Input

Optional: PDF Input (for additional context)


Required fields

medical_note (string, REQUIRED)

Clinical narrative text to process for ICD-10 coding. This field is always required. Examples:
  • “Patient admitted with acute myocardial infarction”
  • “Type 2 Diabetes Mellitus, controlled with oral medications”
  • “Diabetic patient with poor glycemic control, HbA1c 9.2%”
Constraints:
  • Maximum size: 50 KB (~25,000 words)
  • UTF-8 encoding
  • Always required

pdf_file (object, optional)

Optional PDF file object for providing additional context or supporting documents. Structure:
Field constraints:
  • type: Must be "file" (validated)
  • source_type: Must be "base64" (validated)
  • data: Base64 encoded PDF content (max 5MB decoded)
  • mime_type: Must be "application/pdf" (validated)
  • filename: String (required)
  • Optional - can be provided alongside medical_note for additional context

Optional fields

model (string, optional)

AI model quality level selection for processing. Available options:
  • "fast" - Fastest processing with good accuracy (recommended for high-volume)
  • "balanced" - Balance between speed and accuracy (default)
  • "high-quality" - Highest accuracy with slower processing (recommended for complex cases)
Default: "balanced" if not specified Example:

Response structure

Success response (HTTP 200)

Error response (HTTP 4xx/5xx)


Response fields explained

final_code_assessments (array)

Array of approved ICD-10 code assessments selected by the AI. Each assessment contains:
  • code (string): ICD-10 medical code (e.g., “E11.9”)
  • description (string): Medical description of the code
  • justification (string): AI reasoning for code selection
  • confidence_percent (number): Confidence score (0-100)

discarded_code_assessments (array)

Array of considered but rejected code assessments. Shows the AI’s decision-making process and codes that were evaluated but not included. Same structure as final_code_assessments

run_id (string)

Unique identifier (UUID) for this codification run. Uses:
  • Tracking and auditing
  • Debugging issues
  • Correlating with backend logs
  • Support requests

Special cases

Very long input

If your clinical text exceeds 50KB or PDF exceeds 5MB: Option 1: Split into multiple calls
Option 2: Compress and optimize
  • For text: Remove unnecessary whitespace and formatting
  • For PDFs: Compress PDF before encoding, remove non-essential pages
Option 3: Request enterprise limits Contact your sales representative for plans with higher limits.

PDF file encoding

To encode a PDF file for the API:

Text preprocessing

Optional but recommended:

Request optimization

Batch processing

For processing multiple notes, send parallel requests:

Handling confidence scores

Filter results based on confidence thresholds:

Limits and restrictions

See Complete limits and quotas for detailed information. Main limits:
  • Maximum medical_note size: 50 KB (~25,000 words)
  • Maximum pdf_file size: 5 MB (decoded)
  • Processing timeout: 10 minutes (600 seconds)
  • Rate limit: Varies by customer plan

Next steps

View examples

Real requests and responses

Error handling

Error responses and how to handle them

Authentication

API authentication and headers

OpenAPI Reference

Complete API specification