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

# Add Leads to Campaign

> Add new leads to a campaign either as CSV data or individual contacts. Processes contacts using the same logic as campaign start.



## OpenAPI

````yaml POST /public-api/campaigns/{id}/add-leads
openapi: 3.0.0
info:
  title: Agents Public API
  version: '1.0'
  description: REST API for managing contacts, campaigns, and conversations
  termsOfService: https://agents.nineteen58.co.za/terms
  contact:
    name: API Support
    url: https://agents.nineteen58.co.za/support
    email: support@nineteen58.co.za
servers:
  - url: https://agents.nineteen58.co.za
    description: Production server
security:
  - apiKeyAuth: []
tags: []
paths:
  /public-api/campaigns/{id}/add-leads:
    post:
      tags:
        - Campaign Leads
      summary: Add leads to a campaign
      description: >-
        Add new leads to a campaign either as CSV data or individual contacts.
        Processes contacts using the same logic as campaign start.
      operationId: postpublicapicampaignsidaddleads
      parameters:
        - in: header
          name: x-api-key
          schema:
            type: string
          required: true
          description: API key for authentication
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
          description: Campaign ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - csv
                    csvData:
                      type: string
                      description: CSV data with contact information
                  required:
                    - type
                    - csvData
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - contacts
                    contacts:
                      type: array
                      items:
                        type: object
                        properties:
                          identifier:
                            type: string
                          name:
                            type: string
                          email:
                            type: string
                          channel:
                            type: string
                          personal_context:
                            type: string
                          notes:
                            type: string
                          relevant_information:
                            type: string
                        required:
                          - identifier
                  required:
                    - type
                    - contacts
      responses:
        '200':
          description: Successfully added leads to campaign
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      campaignId:
                        type: string
                      totalContacts:
                        type: integer
                      successCount:
                        type: integer
                      errorCount:
                        type: integer
                      processedContacts:
                        type: array
                        items:
                          type: object
                          properties:
                            identifier:
                              type: string
                            contactId:
                              type: string
                            action:
                              type: string
        '400':
          description: Bad request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing authentication token
        '404':
          description: Campaign not found
        '500':
          description: Internal server error
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````