---
title: "Upload an approved, de-identified practice packet for a customer"
method: POST
path: "/accountant/companies/{customerId}/practice-packets"
tags: ["Accountant Portal"]
---

# Upload an approved, de-identified practice packet for a customer

`POST /accountant/companies/{customerId}/practice-packets`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/practice-packets`
- Auth: HTTP bearer

Stores one practice packet (format `practice-packet/v1`, #1805): aggregate rows only, approved by a named person. Every object is strict, so a field the format does not name is rejected (422). The packet must be internally consistent: missing counts never read as zero (every month has its practice totals, every channel its spend row, every therapist its service and retention rows, and acquisition rows add up to the practice's new clients), therapist-specific spend stays within the channel's source spend, each retention row decomposes into retained, new, reactivated and transferred-in clients, the history starts no later than the report window, acquisition and service sources cover from the history start and every source covers what it feeds through the cutoff, a complete retention lookback is covered from 89 days before the opening snapshot, clients served are at least the clients new or active in the history, a cohort with no clients has no collections, and the approval follows every extraction. The packet's `companyId` must be the customer and its approval must not be in the future (422). Packets are immutable: sending the same bytes again returns the stored packet with `created: false` (200); a new packet returns 201. The current packet is the newest cutoff, then the newest approval, then the newest upload, so an older cutoff never replaces a newer one and a correction is a later approval of the same cutoff. Human sessions only: API keys are refused (403). Not gated by the customer's additionalMetrics list.

## Path parameters

- `customerId` string, uuid, required

## Request body

- PracticePacketV1: Practice packet format v1 (#1805). Aggregates only: money is integer cents in `currency`, counts are nonnegative integers, dates are YYYY-MM-DD and months YYYY-MM. Labels are reviewed display labels and carry the email and phone tripwires; no other free text is accepted. Every month has its practice totals, every channel its spend row and every therapist its service and retention rows; acquisition rows may be sparse (an absent therapist and channel pair is zero) because each month's rows must add up to the month's practice new clients.
  - `formatVersion` 'practice-packet/v1', required
  - `companyId` string, uuid, required
  - `currency` string, required: A supported two-decimal ISO 4217 code
  - `timezone` string, required: An IANA Area/Location time zone
  - `reportWindow` object, required: Inclusive whole months; `end` is the cutoff.
    - `start` string, date, required
    - `end` string, date, required
  - `history` object, required: The service-value window runs from `start` to the cutoff and must not start after the report window; `complete` claims full practice history, so no client may be active at an opening snapshot before `start`.
    - `start` string, date, required
    - `complete` boolean, required
  - `definitions` object, required
    - `definitionVersion` string, required
    - `attributionPolicyVersion` string, required
    - `costPolicyVersion` string, required
    - `channelMappingVersion` string, required
    - `spendAllocationRule` 'acquired_client_share_v1', required: The allocation the API applies. Therapist-specific spend first; each channel-month's remaining spend is split by that channel's new clients per therapist, floors first, the leftover cents to the largest remainders, ties by therapist key.
    - `retentionWindowDays` 90, required
  - `sources` object[], required
    - `key` string, required
    - `label` string, required
    - `feeds` string[], required: acquisition decides first-ever clients (visits) and serviceValue collections and costs, both from history.start; attribution (channels), spend and retention from the report window start
    - `dateBasis` 'appointment_date' | 'service_date' | 'payment_date' | 'pay_date' | 'posting_date', required: The date that assigns this source's rows to a month
    - `coverageStart` string, date, required
    - `coverageEnd` string, date, required
    - `extractedAt` string, date-time, required: When the export was pulled. It must fall after coverageEnd has ended in the packet's timezone, because an export pulled on that day misses the rest of it.
  - `approval` object, required
    - `approvedBy` string, required
    - `approvedAt` string, date-time, required
    - `privacyReviewed` true, required
  - `reconciliation` object, required
    - `status` 'reconciled', required: The approver's attestation that the sources reconcile
    - `railOverlapRemovedCents` integer, required
    - `pendingExcludedCount` integer, required
    - `failedExcludedCount` integer, required
  - `therapists` object[], required
    - `key` string, required
    - `label` string, required
    - `role` 'clinician' | 'owner' | 'unassigned', required
    - `activeFrom` string, date: #4963: approved first day on the roster (inclusive); omit for no start date
    - `activeTo` string, date, nullable: #4963: approved last day on the roster (inclusive), on or after activeFrom; omit or null while still on it
  - `channels` object[], required: At least one channel; a channel with no spend still sends its explicit zero spend row.
    - `key` string, required: snake_case; `unattributed` is reserved
    - `label` string, required
  - `acquisition` object[], required: Actual new clients by month, first therapist and channel (`unattributed` when no channel is documented).
    - `month` string, required
    - `therapist` string, required
    - `channel` string, required
    - `newClients` integer, required
  - `practiceAcquisition` object[], required
    - `month` string, required
    - `newClients` integer, required
  - `spend` object[], required: Approved channel spend per month (explicit 0 for none); `direct` is therapist-specific spend. The rest is split by acquired-client share.
    - `month` string, required
    - `channel` string, required
    - `sourceSpendCents` integer, required
    - `direct` object[], required
      - `therapist` string, required
      - `cents` integer, required
  - `serviceValue` object[], required
    - `therapist` string, required
    - `grossCollectionsCents` integer, required
    - `refundsCents` integer, required
    - `directCostCents` integer, nullable, required
    - `directCostUnknownReason` 'owner_policy_pending' | 'not_supplied' | 'null', nullable, required
    - `uniqueClientsServed` integer, required: Distinct clients served, including those with zero collections
    - `ownerEstimate` PracticePacketOwnerEstimate: Optional, and only on the serviceValue row of the therapist whose role is `owner` (#1805, decided 2026-11-06): what her pay would cost if she were paid like a staff clinician. That row keeps `directCostCents: null` with `directCostUnknownReason: owner_policy_pending`, so her actual LTGP stays held; no practice total or LTV:CAC uses the estimate. Net collections (gross less refunds, over the history) must not be negative. The API checks `modeledPayCents` = net collections × `payRateBasisPoints` / 10000 and `employerTaxCents` = `modeledPayCents` × `employerTaxBasisPoints` / 10000, each rounded half up, and that `approvedOn` is not after the UTC day of `approval.approvedAt`. `cardFeesCents` is the owner's card fees, which the estimate subtracts.
      - `method` 'comparable_clinician_rate_v1', required
      - `payRateBasisPoints` integer, required: Share of net collections paid; 6000 is 60%
      - `employerTaxBasisPoints` integer, required: Employer payroll tax on that pay; 765 is 7.65%
      - `modeledPayCents` integer, required
      - `employerTaxCents` integer, required
      - `cardFeesCents` integer, required
      - `approvedBy` string, required: A label, like the packet's approver: no email address or phone-shaped text (7 or more digits)
      - `approvedOn` string, date, required
  - `practiceServiceValue` object, required
    - `grossCollectionsCents` integer, required
    - `refundsCents` integer, required
    - `uniqueClientsServed` integer, required: Deduplicated across therapists independently
  - `acquiredCohorts` object[], required
    - `month` string, required
    - `therapist` string, required
    - `channel` string, required
    - `newClients` integer, required
    - `netCollectionsCents` integer, required
  - `retention` object[], required
    - `month` string, required
    - `therapist` string, required
    - `openingActive` integer, required
    - `retainedOpening` integer, required
    - `closingActive` integer, required
    - `newClients` integer, required
    - `reactivated` integer, required
    - `transfersIn` integer, required
    - `transfersOut` integer, required
  - `practiceRetention` object[], required
    - `month` string, required
    - `lookbackComplete` boolean, required
    - `openingActive` integer, required
    - `retainedOpening` integer, required
    - `closingActive` integer, required
    - `newClients` integer, required
    - `reactivated` integer, required
  - `collectionsByMonth` object[]: #4967, optional: cash collections by payment month and serving therapist, processor overlap already removed (reconciliation.railOverlapRemovedCents); a refund counts in the month it is paid. Only in months every `collections` source (dateBasis payment_date) covers in full, from history.start through the cutoff; one row per therapist and month, an absent row is zero. Give it with practiceCollectionsByMonth.
    - `month` string, required
    - `therapist` string, required
    - `grossCollectionsCents` integer, required
    - `refundsCents` integer, required
  - `practiceCollectionsByMonth` object[]: #4967, optional: the practice's row for every month the collections sources cover, equal to that month's therapist rows plus its payments tied to no clinician (median-ops #599). An absent unattributed amount is 0.
    - `month` string, required
    - `grossCollectionsCents` integer, required
    - `refundsCents` integer, required
    - `unattributedGrossCollectionsCents` integer
    - `unattributedRefundsCents` integer
  - `leadFunnel` PracticeLeadFunnel: #4964, optional (Lead's option A, bounded): lead-to-eight-sessions counts by lead month, as scripts/practice-lead-funnel-fragment.ts prints them from the refreshing person's de-identified export; aggregates only, no client-level row. `cutoff` is the packet's cutoff and `coverage.sessionsThrough` equals it. `cohorts` holds exactly the whole months that both the leads and the sessions coverage hold, through the cutoff, zeros included (at most 24). In each cohort the practice row is the therapist rows' sum, `leads` plus `unassignedLeads`; `broughtClients` covers the therapist rows' brought clients; `sessions.attendedPaid` covers the practice's `firstCompletedPaid`. In each therapist row (a roster key, once per month): firstBooked ≤ leads, firstCompletedPaid ≤ firstBooked, transferredIn ≤ firstCompletedPaid, milestoneEligible + milestonePending = firstCompletedPaid, reachedEight ≤ milestoneEligible. `firstBooked`, `transferredIn`, `broughtClients`, `sessions.consults` and `sessions.booked` are null when the export doesn't carry them (not covered, never 0; median-ops #599, #601); in a cohort such a field is null in the practice row and every therapist row, or in none, and the checks that use it are skipped. Every other count is a whole number.
    - `definitionVersion` 'lead-funnel-v1', required
    - `milestoneSessions` 8, required
    - `milestoneWindowDays` 180, required
    - `leadDedupeDays` 30, required
    - `cutoff` string, date, required
    - `coverage` object, required
      - `leadsFrom` string, date, required
      - `leadsThrough` string, date, required
      - `sessionsFrom` string, date, required
      - `sessionsThrough` string, date, required
    - `cohorts` object[], required
      - `month` string, required
      - `practice` LeadFunnelStage, required: #4964: one cohort's leads through each stage. Credit: the clinician of the first completed and paid session, else of the first booked one. reachedEight counts eligible leads only (their 180-day window ended by the cutoff); milestonePending counts windows still open.
        - `leads` integer, required
        - `firstBooked` integer, nullable, required: Null when the export doesn't carry bookings (not covered, never 0).
        - `firstCompletedPaid` integer, required
        - `transferredIn` integer, nullable, required: Null when the export doesn't carry first bookings, so a move can't be told (not covered, never 0).
        - `reachedEight` integer, required
        - `milestoneEligible` integer, required
        - `milestonePending` integer, required
      - `unassignedLeads` integer, required
      - `broughtClients` integer, nullable, required
      - `sessions` LeadFunnelSessionCounts, required: #4964: the cohort's sessions, each counted once however many payments or processors it has. booked: non-consult sessions not attended (upcoming, no-show or cancelled).
        - `consults` integer, nullable, required: Null when the export doesn't carry consults (not covered, never 0).
        - `booked` integer, nullable, required: Null when the export doesn't carry unattended bookings (not covered, never 0).
        - `attendedUnpaid` integer, required
        - `attendedPaid` integer, required
      - `therapists` intersection[], required
        - intersection
          - [`LeadFunnelStage`](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b/schema?at=%2Fcomponents%2Fschemas%2FLeadFunnelStage)
          - object
            - `therapist` string, required
            - `broughtClients` integer, nullable, required

## Response `200`

The same packet was already stored; nothing changed

- PracticePacketReceiptResponse
  - `success` true, required
  - `data` object, required
    - `packet` PracticePacketSummary, required
      - `id` string, uuid, required
      - `companyId` string, uuid, required
      - `formatVersion` string, required
      - `reportStart` string, date, required
      - `cutoff` string, date, required
      - `historyStart` string, date, required
      - `approvedBy` string, required
      - `approvedAt` string, date-time, required
      - `sha256` string, required: SHA-256 of the key-sorted packet JSON
      - `uploadedByUserId` string, uuid, nullable, required
      - `createdAt` string, date-time, required
    - `created` boolean, required: False when the same bytes were already stored
    - `current` boolean, required: Whether this packet is now the one the customer sees

## Other responses

- `201`: Packet stored
- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `422`: Request failed validation

## Changes

- **2026-11-19** `96dc1148df17`: 2 info
  - the request property `leadFunnel/cohorts/items/practice/transferredIn` became nullable
  - the request property `leadFunnel/cohorts/items/therapists/items/allOf[#/components/schemas/LeadFunnelStage]/transferredIn` became nullable
- **2026-11-19** `4221d727b94f`: 8 info
  - added the new optional request property `practiceCollectionsByMonth/items/unattributedGrossCollectionsCents`
  - added the new optional request property `practiceCollectionsByMonth/items/unattributedRefundsCents`
  - the request property `leadFunnel/cohorts/items/broughtClients` became nullable
  - the request property `leadFunnel/cohorts/items/practice/firstBooked` became nullable
  - …4 more
- **2026-11-19** `7c5ea8542f44`: 1 info
  - added the new optional request property `leadFunnel`
- **2026-11-19** `fd3e388e1643`: 3 info
  - added the new optional request property `collectionsByMonth`
  - added the new optional request property `practiceCollectionsByMonth`
  - added the new `collections` enum value to the request property `sources/items/feeds/items/`
- **2026-11-19** `f4703765b8c3`: 2 info
  - added the new optional request property `therapists/items/activeFrom`
  - added the new optional request property `therapists/items/activeTo`

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/practice-packets/post.md)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) - [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) - [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b?raw)
