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

# Add Contact to Campaign

> This endpoint first uplaods a contact, then adds them to a campaign.

### Path Parameters

- campaign_id (`int`): The ID of the campaign to which the contacts are being added.

### Query Parameters

- bot_id (`int`): (Optional) The ID of the bot responsible for managing the contact's email exchanges within the campaign.
    If not provided, the system will manually assign the contact to a bot.
- notify (`bool`): A flag the users associated with the campaign should be notified about the new contact. Default is `True`.

### Request Body

- contact (`ContactUpload`): An object containing the contact details to be added to the campaign.

### Headers

`X-API-Key`: The API key for authenticating the request.

### Response

`BaseItem`: The ID of the newly inserted contact.

### Errors

- `400 Bad Request`: If the contact is already associated with the organisation or there are
    no bots in the organisation.
- `401 Unauthorized`: If the API key is invalid.
- `404 Not Found`: If the campaign does not exist or is not associated with the organisation.



## OpenAPI

````yaml POST /api/v1/campaigns/{campaign_id}/contacts/upload
openapi: 3.1.0
info:
  title: ChaseLabs API
  version: 0.1.0
servers:
  - url: https://services.meetchase.ai
security: []
paths:
  /api/v1/campaigns/{campaign_id}/contacts/upload:
    post:
      tags:
        - Public API Routes
        - Campaign Routes
        - Campaign Contact Routes
      summary: Upload Contact And Add To Campaign Api
      description: >-
        This endpoint first uplaods a contact, then adds them to a campaign.


        ### Path Parameters


        - campaign_id (`int`): The ID of the campaign to which the contacts are
        being added.


        ### Query Parameters


        - bot_id (`int`): (Optional) The ID of the bot responsible for managing
        the contact's email exchanges within the campaign.
            If not provided, the system will manually assign the contact to a bot.
        - notify (`bool`): A flag the users associated with the campaign should
        be notified about the new contact. Default is `True`.


        ### Request Body


        - contact (`ContactUpload`): An object containing the contact details to
        be added to the campaign.


        ### Headers


        `X-API-Key`: The API key for authenticating the request.


        ### Response


        `BaseItem`: The ID of the newly inserted contact.


        ### Errors


        - `400 Bad Request`: If the contact is already associated with the
        organisation or there are
            no bots in the organisation.
        - `401 Unauthorized`: If the API key is invalid.

        - `404 Not Found`: If the campaign does not exist or is not associated
        with the organisation.
      operationId: >-
        upload_contact_and_add_to_campaign_api_api_v1_campaigns__campaign_id__contacts_upload_post
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
            title: Campaign Id
        - name: bot_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Bot Id
        - name: notify
          in: query
          required: false
          schema:
            type: boolean
            default: true
            title: Notify
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactUpload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - API Key: []
components:
  schemas:
    ContactUpload:
      properties:
        custom_data:
          additionalProperties: true
          type: object
          title: Custom Data
          default: {}
        email:
          type: string
          format: email
          title: Email
        first_name:
          anyOf:
            - type: string
              maxLength: 63
              minLength: 1
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
              maxLength: 63
              minLength: 1
            - type: 'null'
          title: Last Name
        city:
          anyOf:
            - type: string
              maxLength: 63
              minLength: 1
            - type: 'null'
          title: City
        country:
          anyOf:
            - type: string
              maxLength: 63
              minLength: 1
            - type: 'null'
          title: Country
        tags:
          items:
            type: string
            maxLength: 31
            minLength: 1
          type: array
          maxItems: 16
          title: Tags
          default: []
      type: object
      required:
        - email
      title: ContactUpload
      examples:
        - city: London
          country: United Kingdom
          custom_data:
            age: 26
            role: Sales Manager
          email: tara@example.com
          first_name: Tara
          last_name: Williams
          tags:
            - finance
            - manager
    BaseItem:
      properties:
        id:
          type: integer
          title: Id
      type: object
      required:
        - id
      title: BaseItem
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    API Key:
      type: apiKey
      description: Key used to authenticate user API requests.
      in: header
      name: X-API-Key

````