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

# Create Cohort



## OpenAPI

````yaml post /comms/cohorts
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /comms/cohorts:
    post:
      tags:
        - Audience Cohorts
      summary: Create Cohort
      operationId: create_cohort_comms_cohorts_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CohortCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CohortSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CohortCreate:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        filterCriteria:
          $ref: '#/components/schemas/CohortFilters'
        senderId:
          type: string
          title: Senderid
      type: object
      required:
        - name
        - senderId
      title: CohortCreate
    CohortSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        filterCriteria:
          additionalProperties: true
          type: object
          title: Filtercriteria
        createdById:
          type: string
          title: Createdbyid
        createdDate:
          type: string
          format: date-time
          title: Createddate
      type: object
      required:
        - id
        - name
        - filterCriteria
        - createdById
        - createdDate
      title: CohortSummary
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CohortFilters:
      properties:
        cohortKind:
          anyOf:
            - $ref: '#/components/schemas/CohortKind'
            - type: 'null'
          description: 'Cohort type: ''filter'' (default) or ''custom_list'''
        customList:
          anyOf:
            - $ref: '#/components/schemas/CustomListFilters'
            - type: 'null'
          description: >-
            Normalized contact list for custom-list cohorts (mutually exclusive
            with dynamic filters)
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
        dateOfBirth:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - type: 'null'
          title: Dateofbirth
        birthday:
          anyOf:
            - items:
                type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Birthday
        createdDate:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Createddate
        tagIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tagids
          description: Filter by patient tag IDs
        tagIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tagidsexclude
          description: Exclude patients with ANY of these tag IDs
        tagIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Tagidsmode
          description: >-
            Match mode for tag_ids: 'any' (has ANY) or 'all' (has ALL). Default:
            'all'
        locationIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Locationids
          description: Filter by primary location IDs
        locationIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Locationidsexclude
          description: Exclude patients at these location IDs
        leadSource:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Leadsource
          description: Filter by lead source
        leadSourceExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Leadsourceexclude
          description: Exclude patients with these lead sources
        smsOptOut:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Smsoptout
          description: Filter by combined SMS opt-out status ('true' or 'false')
        onSchedulingBlacklist:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Onschedulingblacklist
          description: Filter by scheduling blacklist status ('true' or 'false')
        optedInToSmsMarketing:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Optedintosmsmarketing
          description: >-
            Filter by SMS marketing opt-in status ('true', 'false', or
            'not_set')
        optedInToEmailMarketing:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Optedintoemailmarketing
          description: >-
            Filter by email marketing opt-in status ('true', 'false', or
            'not_set')
        optedInToSocialMedia:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Optedintosocialmedia
          description: Filter by social media consent status ('true' or 'false')
        appointmentCount:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Appointmentcount
          description: Filter by appointment count [min, max], null = unbounded
        lastAppointmentDays:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Lastappointmentdays
          description: Filter by days since last appointment [min, max], null = unbounded
        lastAppointmentServiceIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Lastappointmentserviceids
          description: >-
            Scope the 'time since last appointment' recency to these service
            IDs. Omit to measure recency across all appointments.
        lastAppointmentUnit:
          anyOf:
            - type: string
              enum:
                - days
                - weeks
                - months
                - years
            - type: 'null'
          title: Lastappointmentunit
          description: >-
            Display-only unit the user chose for the last-appointment recency
            range. The stored range is always in days; this only affects how it
            renders. Default: 'days'.
        visitSpanDays:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Visitspandays
          description: >-
            Filter by visit span in days (last appointment − first appointment)
            [min, max], null = unbounded
        totalSpent:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Totalspent
          description: Filter by total spent in cents [min, max], null = unbounded
        membershipIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Membershipids
          description: Filter by active membership IDs
        membershipIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Membershipidsexclude
          description: Exclude patients with these active memberships
        membershipIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Membershipidsmode
          description: 'Match mode for membership_ids: ''any'' or ''all''. Default: ''any'''
        packageIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Packageids
          description: Filter by active package IDs
        packageIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Packageidsexclude
          description: Exclude patients with these active packages
        packageIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Packageidsmode
          description: 'Match mode for package_ids: ''any'' or ''all''. Default: ''any'''
        appointmentTypeIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Appointmenttypeids
          description: Filter by service IDs from completed appointments
        appointmentTypeIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Appointmenttypeidsexclude
          description: Exclude patients who completed these appointment types
        appointmentTypeIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Appointmenttypeidsmode
          description: 'Match mode for appointment_type_ids: ''any'' or ''all''. Default: ''any'''
        appointmentDateRange:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Appointmentdaterange
          description: Filter by appointment date range [start, end]
        completedAppointmentServiceIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Completedappointmentserviceids
          description: >-
            Service IDs that must have been COMPLETED within
            completed_appointment_date_range. Omit to match any completed
            appointment in the window.
        completedAppointmentDateRange:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Completedappointmentdaterange
          description: >-
            Window [start, end] in which an appointment must have been
            COMPLETED. Narrowed to specific services when
            completed_appointment_service_ids is set.
        createdAppointmentServiceIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Createdappointmentserviceids
          description: >-
            Service IDs that must have been BOOKED within
            created_appointment_date_range. Omit to match any appointment booked
            in the window.
        createdAppointmentDateRange:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Createdappointmentdaterange
          description: >-
            Window [start, end] in which an appointment must have been BOOKED
            (created), keyed on the appointment's creation timestamp rather than
            its scheduled date. Narrowed to specific services when
            created_appointment_service_ids is set.
        noAppointmentServiceIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Noappointmentserviceids
          description: >-
            Restrict no_appointment_date_range to appointments for these service
            IDs. Omit to match any appointment in the window.
        noAppointmentDateRange:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Noappointmentdaterange
          description: >-
            Patients with NO non-cancelled appointment (optionally for
            no_appointment_service_ids) in this date range [start, end]
        weight:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Weight
          description: Filter by latest weight in lbs [min, max], null = unbounded
        gender:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Gender
          description: Filter by gender values
        genderExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Genderexclude
          description: Exclude patients with these genders
        patientSource:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Patientsource
          description: Filter by patient source
        patientSourceExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Patientsourceexclude
          description: Exclude patients from these sources
        preferredProviderId:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Preferredproviderid
          description: Filter by preferred provider IDs
        preferredProviderIdExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Preferredprovideridexclude
          description: Exclude patients with these preferred providers
        mostRecentProviderId:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Mostrecentproviderid
          description: Filter by provider IDs from most recent completed appointment
        mostRecentProviderIdExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Mostrecentprovideridexclude
          description: >-
            Exclude patients whose most recent completed appointment was with
            these providers
        mostRecentProviderMissing:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Mostrecentprovidermissing
          description: >-
            Filter by presence of a provider on the latest completed appointment
            ('true' → patient has none, or no completed appointments at all).
        creditBalance:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Creditbalance
          description: Filter by credit balance in cents [min, max]
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
        lastActiveDays:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Lastactivedays
          description: Filter by days since last active [min, max]
        optedOutOfEmail:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Optedoutofemail
          description: Filter by email opt-out status ('true' or 'false')
        age:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Age
          description: Filter by current age in years [min, max], null = unbounded
        height:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Height
          description: Filter by latest height in inches [min, max], null = unbounded
        goalWeight:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Goalweight
          description: Filter by goal weight in lbs [min, max], null = unbounded
        systolicBp:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Systolicbp
          description: Filter by latest systolic BP in mmHg [min, max], null = unbounded
        diastolicBp:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Diastolicbp
          description: Filter by latest diastolic BP in mmHg [min, max], null = unbounded
        waistCircumference:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Waistcircumference
          description: >-
            Filter by latest waist circumference in inches [min, max], null =
            unbounded
        pulse:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Pulse
          description: Filter by latest pulse in BPM [min, max], null = unbounded
        temperature:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - type: 'null'
          title: Temperature
          description: Filter by latest temperature in °F [min, max], null = unbounded
        hasProfilePicture:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasprofilepicture
          description: Filter by profile picture presence ('true' or 'false')
        pronouns:
          anyOf:
            - type: string
            - type: 'null'
          title: Pronouns
          description: Filter by pronouns text
        preferredName:
          anyOf:
            - type: string
            - type: 'null'
          title: Preferredname
          description: Filter by preferred name text
        surchargeDisabled:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Surchargedisabled
          description: Filter by surcharge disabled status ('true' or 'false')
        hasNotes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasnotes
          description: Filter by note presence ('true' or 'false')
        hasActiveChat:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasactivechat
          description: Filter by active chat presence ('true' or 'false')
        medicationCount:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Medicationcount
          description: Filter by active medication count [min, max], null = unbounded
        hasEmail:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasemail
          description: Filter by email presence ('true' or 'false')
        hasPhoneNumber:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasphonenumber
          description: Filter by phone number presence ('true' or 'false')
        hasMembership:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasmembership
          description: >-
            Filter by active, frozen, or delinquent membership presence ('true'
            or 'false')
        hasTags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hastags
          description: Filter by tag presence ('true' or 'false')
        hasFutureAppointments:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hasfutureappointments
          description: Filter by future appointment presence ('true' or 'false')
        cancelledAppointmentDateRange:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    format: date-time
                  - type: string
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Cancelledappointmentdaterange
          description: Filter by cancelled appointment date range [start, end]
        cancelledAppointmentDays:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Cancelledappointmentdays
          description: Days since last cancelled appointment [min, max], null = unbounded
        lastAppointmentStatus:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Lastappointmentstatus
          description: Status of patient's most recent appointment
        outstandingBalance:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Outstandingbalance
          description: Filter by outstanding balance in cents [min, max]
        outstandingBalanceDays:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Outstandingbalancedays
          description: Filter by days since oldest outstanding charge [min, max]
        purchasedItemIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Purchaseditemids
          description: Filter by purchased item IDs from charges
        purchasedItemIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Purchaseditemidsexclude
          description: Exclude patients who purchased these items
        purchasedItemIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Purchaseditemidsmode
          description: 'Match mode for purchased_item_ids: ''any'' or ''all''. Default: ''any'''
        hasPaymentPlan:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Haspaymentplan
          description: Filter by payment plan presence ('true' or 'false')
        lastPaymentDays:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - type: 'null'
          title: Lastpaymentdays
          description: Filter by days since last successful payment [min, max]
        lastPaymentStatus:
          anyOf:
            - items:
                $ref: '#/components/schemas/PaymentStatus'
              type: array
            - type: 'null'
          title: Lastpaymentstatus
          description: Status of patient's most recent payment
        lastPaymentStatusExclude:
          anyOf:
            - items:
                $ref: '#/components/schemas/PaymentStatus'
              type: array
            - type: 'null'
          title: Lastpaymentstatusexclude
          description: Exclude patients whose last payment status matches
        hasPaymentMethod:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Haspaymentmethod
          description: Filter by saved payment method presence ('true' or 'false')
        membershipStatuses:
          anyOf:
            - items:
                $ref: '#/components/schemas/MemberStatus'
              type: array
            - type: 'null'
          title: Membershipstatuses
          description: Filter by membership status values
        membershipStatusesExclude:
          anyOf:
            - items:
                $ref: '#/components/schemas/MemberStatus'
              type: array
            - type: 'null'
          title: Membershipstatusesexclude
          description: Exclude patients with memberships in these statuses
        discountTypes:
          anyOf:
            - items:
                $ref: '#/components/schemas/DiscountType'
              type: array
            - type: 'null'
          title: Discounttypes
          description: >-
            Filter by patients who hold a currently-redeemable discount of these
            source types (e.g. MEMBERSHIP, PACKAGE, PROMOTION)
        discountTypesExclude:
          anyOf:
            - items:
                $ref: '#/components/schemas/DiscountType'
              type: array
            - type: 'null'
          title: Discounttypesexclude
          description: >-
            Exclude patients who hold a currently-redeemable discount of these
            source types
        discountTemplateIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Discounttemplateids
          description: >-
            Filter by patients who hold a currently-redeemable discount from
            these discount templates
        discountTemplateIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Discounttemplateidsexclude
          description: >-
            Exclude patients who hold a currently-redeemable discount from these
            discount templates
        discountTemplateIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Discounttemplateidsmode
          description: 'Match mode for discount_template_ids: ''any'' or ''all''. Default: ''any'''
        discountBenefitItemIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Discountbenefititemids
          description: >-
            Filter by patients who hold a currently-redeemable discount
            targeting these items (e.g. a Nutrition consult included in their
            package/membership)
        discountBenefitItemIdsExclude:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Discountbenefititemidsexclude
          description: >-
            Exclude patients who hold a currently-redeemable discount targeting
            these items
        discountBenefitItemIdsMode:
          anyOf:
            - type: string
              enum:
                - any
                - all
            - type: 'null'
          title: Discountbenefititemidsmode
          description: >-
            Match mode for discount_benefit_item_ids: 'any' or 'all'. Default:
            'any'
      type: object
      title: CohortFilters
      description: >-
        Reusable cohort filter fields (no pagination/sort/transport).


        Field list mirrors ``PatientFetchParams`` in
        ``decoda/schemas/patient.py``;

        keep in sync or explicitly diverge. The two schemas are intentionally

        decoupled so cohort and patient-table can evolve independently.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CohortKind:
      type: string
      enum:
        - filter
        - custom_list
      title: CohortKind
      description: |-
        Discriminates how a cohort resolves to patients.

        ``FILTER`` cohorts hold dynamic patient-filter criteria; ``CUSTOM_LIST``
        cohorts hold a normalized list of emails/phone numbers that resolve to
        matching patients.
    CustomListFilters:
      properties:
        emails:
          items:
            type: string
          type: array
          title: Emails
        phoneNumbers:
          items:
            type: string
          type: array
          title: Phonenumbers
      type: object
      title: CustomListFilters
      description: >-
        Normalized contact-list filters for custom-list cohorts.


        ``emails``/``phone_numbers`` are normalized and deduped at the boundary
        by

        the shared ``contact_list`` helpers, so a write re-normalizes
        idempotently

        regardless of how the values arrived (client preview output, stored
        JSONB).
    PaymentStatus:
      type: string
      enum:
        - CANCELED
        - CREATED
        - FAILED
        - IN_REVIEW
        - PRESENTING
        - PROCESSING
        - SUCCEEDED
      title: PaymentStatus
      description: >-
        Status of a Payment or Refund.


        NOTE for any "cash collected / refunded" or settlement-style query:

        both ``SUCCEEDED`` AND ``PROCESSING`` count as money committed.
        ``SUCCEEDED``

        means cleared in the bank account; ``PROCESSING`` means the transaction
        is

        in flight (e.g. ACH still settling) but the clinic should expect it.
        Most

        accounting / analytics aggregates that filter only on ``status ==
        SUCCEEDED``

        silently undercount real cash flow — use ``status IN (SUCCEEDED,
        PROCESSING)``

        unless you specifically want only fully-cleared funds.


        Use ``COMMITTED_PAYMENT_STATUSES`` below for the common case.
    MemberStatus:
      type: string
      enum:
        - ACTIVE
        - EXPIRED
        - CANCELLED
        - DELINQUENT
        - FROZEN
        - INACTIVE
        - PENDING
        - AWAITING_FORM
      title: MemberStatus
    DiscountType:
      type: string
      enum:
        - GLOBAL
        - CUSTOM
        - MEMBERSHIP
        - PACKAGE
        - SAVED_ITEM
        - PROMOTION
      title: DiscountType

````