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

# Import Waitlist

> Add targets from entries read off the EHR (waitlist, recalls, referrals, upcoming appointments), shaped the way the EHR preview endpoints return them. Each target's external_id is the entry's EHR id, so with allow_duplicates false an entry the campaign already holds is skipped.



## OpenAPI

````yaml https://voice.getprosperapp.com/openapi.json post /api/v1/campaigns/{campaign_id}/targets/import-waitlist
openapi: 3.1.0
info:
  title: Prosper Voice
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/campaigns/{campaign_id}/targets/import-waitlist:
    post:
      tags:
        - Campaigns
      summary: Import Waitlist
      description: >-
        Add targets from entries read off the EHR (waitlist, recalls, referrals,
        upcoming appointments), shaped the way the EHR preview endpoints return
        them. Each target's external_id is the entry's EHR id, so with
        allow_duplicates false an entry the campaign already holds is skipped.
      operationId: >-
        import_waitlist_api_v1_campaigns__campaign_id__targets_import_waitlist_post
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the campaign to add targets to.
            title: Campaign Id
          description: The ID of the campaign to add targets to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportWaitlistRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ImportWaitlistRequest:
      properties:
        entries:
          items:
            oneOf:
              - $ref: '#/components/schemas/WaitlistImportTargetEntry'
              - $ref: '#/components/schemas/ReferralImportTargetEntry'
              - $ref: '#/components/schemas/RecallImportTargetEntry'
              - $ref: '#/components/schemas/AppointmentImportTargetEntry'
              - $ref: '#/components/schemas/LeadImportTargetEntry'
            discriminator:
              propertyName: source
              mapping:
                appointment: '#/components/schemas/AppointmentImportTargetEntry'
                lead: '#/components/schemas/LeadImportTargetEntry'
                recall: '#/components/schemas/RecallImportTargetEntry'
                referral: '#/components/schemas/ReferralImportTargetEntry'
                waitlist: '#/components/schemas/WaitlistImportTargetEntry'
          type: array
          title: Entries
          description: >-
            Queue entries to import — fetched by the frontend from the
            integrations service.
        launch:
          type: boolean
          title: Launch
          description: Whether to launch the imported targets immediately or only add them.
          default: false
        allow_duplicates:
          type: boolean
          title: Allow Duplicates
          description: >-
            When False, entries already imported (matched on external_id) are
            skipped.
          default: false
        suggested_time_slot:
          anyOf:
            - $ref: '#/components/schemas/SuggestedTimeSlot'
            - type: 'null'
          description: >-
            Slot the agent should pitch on every imported call. Stored on each
            target's input_data.
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
          description: >-
            IANA timezone every imported time is rendered in — the agent's, so
            the strings on the target read the way the agent will say them.
            Defaults to US/Eastern.
          examples:
            - America/New_York
            - America/Chicago
        ehr_source:
          $ref: '#/components/schemas/EHRIntegrationType'
          description: >-
            EHR the entries came from — stamps each target's external_id prefix
            and the patient's extra_data.ehr_source.
          default: modmed
      type: object
      required:
        - entries
      title: ImportWaitlistRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WaitlistImportTargetEntry:
      properties:
        id:
          type: string
          title: Id
          description: EHR-side id of the queue entry this target came from
        patient_id:
          type: string
          title: Patient Id
        patient_first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient First Name
        patient_last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Last Name
        patient_date_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Date Of Birth
        patient_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Phone
        added_to_waitlist_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Added To Waitlist At
          description: When the entry was queued in the EHR.
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Free-text note about the entry, shown to the agent as waitlist_note.
        source:
          type: string
          const: waitlist
          title: Source
          default: waitlist
        appointment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Id
        provider_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Id
        provider_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Name
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Id
        location_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Name
        appointment_type_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Type Id
        appointment_type_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Type Name
        appointment_start:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Start
        appointment_end:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment End
        appointment_duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Appointment Duration Minutes
      type: object
      required:
        - id
        - patient_id
      title: WaitlistImportTargetEntry
      description: >-
        An entry off the EHR's appointment waitlist, with the slot it is waiting
        on.
    ReferralImportTargetEntry:
      properties:
        id:
          type: string
          title: Id
          description: EHR-side id of the queue entry this target came from
        patient_id:
          type: string
          title: Patient Id
        patient_first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient First Name
        patient_last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Last Name
        patient_date_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Date Of Birth
        patient_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Phone
        added_to_waitlist_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Added To Waitlist At
          description: When the entry was queued in the EHR.
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Free-text note about the entry, shown to the agent as waitlist_note.
        source:
          type: string
          const: referral
          title: Source
          default: referral
        appointment_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Reason
          description: Why the visit is being booked, read off the referral document.
        referral_additional_details:
          anyOf:
            - type: string
            - type: 'null'
          title: Referral Additional Details
          description: >-
            Free-text detail from the referral the agent should know before
            calling.
      type: object
      required:
        - id
        - patient_id
      title: ReferralImportTargetEntry
      description: >-
        An entry off the EHR's fax-referral queue, with what was read off the
        PDF.


        It has no appointment: nothing is booked yet, which is why it is being

        called about.
    RecallImportTargetEntry:
      properties:
        id:
          type: string
          title: Id
          description: EHR-side id of the queue entry this target came from
        patient_id:
          type: string
          title: Patient Id
        patient_first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient First Name
        patient_last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Last Name
        patient_date_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Date Of Birth
        patient_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Phone
        added_to_waitlist_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Added To Waitlist At
          description: When the entry was queued in the EHR.
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Free-text note about the entry, shown to the agent as waitlist_note.
        source:
          type: string
          const: recall
          title: Source
          default: recall
        recall_type_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Recall Type Name
        provider_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Id
        provider_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Name
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Id
        location_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Name
        patient_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Address
        patient_zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Zip Code
        appointment_type_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Type Id
        appointment_type_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Type Name
        appointment_duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Appointment Duration Minutes
        due_date:
          anyOf:
            - type: string
            - type: 'null'
          title: Due Date
          description: ISO date the recall is due by.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: OPEN or OVERDUE.
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Why the patient is due back, as the EHR words it.
        last_activity_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Activity Note
          description: >-
            Free text from the last entry the practice logged against the
            recall.
        last_activity_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Activity Type
          description: How that entry was logged, e.g. PHONE_CALL.
        last_activity_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Activity At
          description: ISO datetime that entry was logged.
      type: object
      required:
        - id
        - patient_id
      title: RecallImportTargetEntry
      description: >-
        An entry off the EHR's recall worklist: a patient due back for a visit.


        Like a referral it has no appointment — the recall is the practice's
        note

        that one should be booked, by the due date, for the recall's visit type.
    AppointmentImportTargetEntry:
      properties:
        id:
          type: string
          title: Id
          description: EHR-side id of the queue entry this target came from
        patient_id:
          type: string
          title: Patient Id
        patient_first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient First Name
        patient_last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Last Name
        patient_date_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Date Of Birth
        patient_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Phone
        added_to_waitlist_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Added To Waitlist At
          description: When the entry was queued in the EHR.
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Free-text note about the entry, shown to the agent as waitlist_note.
        source:
          type: string
          const: appointment
          title: Source
          default: appointment
        provider_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Id
        provider_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Name
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Id
        location_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Name
        appointment_type_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Type Id
        appointment_type_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment Type Name
        appointment_start:
          type: string
          title: Appointment Start
          description: ISO datetime the visit starts.
        appointment_end:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointment End
        appointment_duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Appointment Duration Minutes
      type: object
      required:
        - id
        - patient_id
        - appointment_start
      title: AppointmentImportTargetEntry
      description: A booked appointment, for a reminder call. `id` is the appointment id.
    LeadImportTargetEntry:
      properties:
        id:
          type: string
          title: Id
          description: EHR-side id of the queue entry this target came from
        patient_id:
          type: string
          title: Patient Id
          default: ''
        patient_first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient First Name
        patient_last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Last Name
        patient_date_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Date Of Birth
        patient_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Phone
        added_to_waitlist_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Added To Waitlist At
          description: When the entry was queued in the EHR.
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Free-text note about the entry, shown to the agent as waitlist_note.
        source:
          type: string
          const: lead
          title: Source
          default: lead
        patient_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Patient Email
        lead_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Lead Source
          description: Where the CRM says the lead came from, e.g. Web.
        service_interest:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Interest
          description: What the lead asked about on the form.
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: ISO datetime the lead was captured.
      type: object
      required:
        - id
      title: LeadImportTargetEntry
      description: >-
        A marketing Lead off the practice's CRM: someone who filled in a form.


        It is not a patient yet. `id` is the CRM record id, and `patient_id`
        stays

        empty because no EHR chart exists to point at.
    SuggestedTimeSlot:
      properties:
        start:
          type: string
          title: Start
          description: ISO datetime — start of the slot the agent should offer
        end:
          type: string
          title: End
          description: ISO datetime — end of the slot the agent should offer
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text guidance for the agent (e.g. 'morning preferred')
      type: object
      required:
        - start
        - end
      title: SuggestedTimeSlot
    EHRIntegrationType:
      type: string
      enum:
        - eclinicalworks
        - modmed
        - athenapractice
        - drchrono
        - athenahealth
        - modmedapi
        - athenaone
        - ggastro
        - veradigm
        - prosper_ehr
        - greenway_intergy
        - nextgen
        - nextech
        - nextech_practice_plus
        - orchestrator_cerner
        - advancedmd
        - erad
        - ezderm
        - exa
        - carecloud
        - elation
      title: EHRIntegrationType
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.