> ## 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.

# Add Targets

> Add targets to a campaign



## OpenAPI

````yaml https://voice.getprosperapp.com/openapi.json post /api/v1/campaigns/{campaign_id}/targets
openapi: 3.1.0
info:
  title: Prosper Voice
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/campaigns/{campaign_id}/targets:
    post:
      tags:
        - Campaigns
      summary: Add Targets
      description: Add targets to a campaign
      operationId: add_targets_api_v1_campaigns__campaign_id__targets_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/AddTargetsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddTargetsRequest:
      properties:
        targets:
          anyOf:
            - items:
                $ref: '#/components/schemas/TargetInput'
              type: array
            - type: 'null'
          title: Targets
          description: The list of targets as TargetInputs
          examples:
            - - fallback_phone_number: '+19876543210'
                input_data:
                  appointment_date: '2026-04-01'
                  appointment_type: Follow-up
                patient:
                  date_of_birth: '1990-01-15'
                  external_id: PAT-001
                  extra_data:
                    address: 123 Main St, Anytown, USA
                  first_name: John
                  last_name: Doe
                phone_number: '+1234567890'
                pre_call_data:
                  patient_name: John Doe
        launch:
          type: boolean
          title: Launch
          description: >-
            Whether to launch the targets immediately or only add them to the
            campaign
          default: false
        allow_duplicates:
          type: boolean
          title: Allow Duplicates
          description: >-
            When set to True all targets with and external ID already contained
            in the campaign will be ignored
          default: true
      type: object
      title: AddTargetsRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TargetInput:
      properties:
        id:
          type: string
          title: Id
          description: The ID of the target
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: The external ID of the target
        phone_number:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/TargetInputPhoneNumber'
          title: Phone Number
          description: The phone number of the target
        fallback_phone_number:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/TargetInputPhoneNumber'
            - type: 'null'
          title: Fallback Phone Number
          description: The fallback phone number of the target
        input_data:
          additionalProperties: true
          type: object
          title: Input Data
          description: The input data of the target
        patient:
          anyOf:
            - $ref: '#/components/schemas/PatientInput'
            - type: 'null'
          description: Patient to link to this target.
        pre_call_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Pre Call Data
          description: The pre-call data of the target
      type: object
      required:
        - phone_number
      title: TargetInput
    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
    TargetInputPhoneNumber:
      properties:
        value:
          type: string
          title: Value
          description: The phone number of the target
        operating_hours:
          anyOf:
            - $ref: '#/components/schemas/WeekSchedule'
            - type: 'null'
          description: The operating hours of the target
      type: object
      required:
        - value
      title: TargetInputPhoneNumber
    PatientInput:
      properties:
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: Patient first name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: Patient last name
        date_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Date Of Birth
          description: Patient date of birth (YYYY-MM-DD)
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: Patient phone number
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: Patient external ID (e.g. MRN)
        extra_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra Data
          description: Additional patient metadata
      type: object
      title: PatientInput
    WeekSchedule:
      properties:
        monday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Monday
        tuesday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Tuesday
        wednesday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Wednesday
        thursday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Thursday
        friday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Friday
        saturday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Saturday
        sunday:
          items:
            $ref: '#/components/schemas/TimeIntervalNoTz'
          type: array
          title: Sunday
        tz:
          type: string
          title: Tz
          default: US/Eastern
      type: object
      title: WeekSchedule
    TimeIntervalNoTz:
      properties:
        start:
          type: string
          title: Start
        end:
          type: string
          title: End
      type: object
      required:
        - start
        - end
      title: TimeIntervalNoTz

````