> ## Documentation Index
> Fetch the complete documentation index at: https://agents.nanonets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# DrChrono Add Codes To Appointment

> DrChrono coding write-back tool exposed through the Agents Platform.

This document covers `drchrono_add_codes_to_appointment`, the DrChrono coding write-back tool exposed through the Agents Platform.

## Authentication

Uses the DrChrono OAuth connector. The platform injects `access_token`.

## Safety

This is a mutating tool. It creates DrChrono billing line items when called. The realtime coding workflow defaults `dry_run` to `true`; this tool should only be invoked when the biller explicitly opts in with `dry_run=false`.

## `drchrono_add_codes_to_appointment`

Writes approved CPT/ICD/modifier data to a DrChrono appointment through line-item APIs.

### Inputs

Required:

* `appointment_id`: DrChrono appointment ID.
* `charges`: Array of validated charges.

Optional:

* `supervising_provider_id`

Charge object fields:

* `cpt_code`
* `diagnosis_codes`
* `modifiers`
* `pos`
* `tos`
* `units`
* `fee`
* `line_note`

### Output

```json theme={null}
{
  "success": true,
  "appointment_id": "123",
  "applied_charge_count": 2,
  "applied_charge_ids": [],
  "per_charge_errors": {}
}
```

## Human-readable text

The tool emits markdown for the feed: a `## DrChrono Dry Run` / `## DrChrono Codes Applied` summary table, a `## Charges` table (CPT, diagnosis, modifiers, POS, TOS, units, fee, note), and a `## Per-Charge Errors` section on failures. The full payload and applied ids stay in `structuredContent`.

## Agent Instruction Guidance

Never call this tool during the first realtime coding pass. First generate suggestions with `dry_run=true`; call this tool only after biller approval.
