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

# Batch Add Contacts to Campaign

> Add up to 1,000 contacts to a campaign in a single request. Each contact is identified by `cnvContactId`, `userId`, or `email` and processed independently; the response includes a per-contact result indicating success or failure.

> **Request access.** This endpoint is not enabled by default, contact the Conversion team to request access. Calls from accounts without it return `403 export_not_enabled`.



## OpenAPI

````yaml /openapi.json post /v2/campaigns/{campaignId}/contacts/batch
openapi: 3.1.0
info:
  title: Conversion API
  version: 2.0.0
  description: >-
    The Conversion API lets you programmatically manage contacts, track custom
    events, and manage their associated data.
servers:
  - url: https://pub-api.conversion.ai/api
security:
  - apiKey: []
paths:
  /v2/campaigns/{campaignId}/contacts/batch:
    post:
      summary: Batch Add Contacts to Campaign
      description: >-
        Add up to 1,000 contacts to a campaign in a single request. Each contact
        is identified by `cnvContactId`, `userId`, or `email` and processed
        independently; the response includes a per-contact result indicating
        success or failure.


        > **Request access.** This endpoint is not enabled by default, contact
        the Conversion team to request access. Calls from accounts without it
        return `403 export_not_enabled`.
      operationId: batchAddContactsToCampaign
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the campaign to add the contacts to.
          examples:
            example:
              value: b7c8d9e0-f1a2-3456-bcde-f01234567890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contacts
              properties:
                contacts:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  description: >-
                    An array of contacts to add to the campaign. Each contact is
                    identified by `cnvContactId`, `userId`, or `email`
                    (resolution precedence: `cnvContactId`, then `userId`, then
                    `email`).
                  items:
                    type: object
                    description: A single contact to add.
                    properties:
                      email:
                        type: string
                        format: email
                        description: >-
                          The contact's email address. At least one of
                          `cnvContactId`, `userId`, or `email` is required.
                        examples:
                          - jane@example.com
                      cnvContactId:
                        type: string
                        format: uuid
                        description: >-
                          The Conversion contact ID. At least one of
                          `cnvContactId`, `userId`, or `email` is required.
                        examples:
                          - a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      userId:
                        type: string
                        description: >-
                          An external user identifier for the contact. At least
                          one of `cnvContactId`, `userId`, or `email` is
                          required.
                        examples:
                          - user_12345
            examples:
              mixed-identifiers:
                summary: Add contacts by different identifiers
                value:
                  contacts:
                    - email: jane@example.com
                    - cnvContactId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    - userId: user_12345
      responses:
        '200':
          description: >-
            Batch processed. Check each result for per-contact success or
            failure.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    required:
                      - results
                    properties:
                      results:
                        type: array
                        description: >-
                          Per-contact results, in the same order as the
                          request's `contacts` array.
                        items:
                          type: object
                          required:
                            - added
                          properties:
                            added:
                              type: boolean
                              description: >-
                                `true` once the contact is a member. The
                                operation is idempotent.
                            cnvContactId:
                              type: string
                              format: uuid
                              description: >-
                                The resolved Conversion contact ID. Present when
                                the contact was resolved.
                            error:
                              type: string
                              description: >-
                                A machine-readable error code. Present when
                                `added` is `false`.
                            message:
                              type: string
                              description: >-
                                A human-readable error description. Present when
                                `added` is `false`.
              examples:
                mixed-results:
                  summary: Mixed results
                  value:
                    data:
                      results:
                        - added: true
                          cnvContactId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                        - added: false
                          error: contact_not_found
                          message: no contact found matching the provided identifier
        '400':
          description: The request was malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid-request:
                  summary: Invalid request body
                  value:
                    error:
                      code: invalid_request
                      message: request validation failed
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized:
                  summary: Missing or invalid API key
                  value:
                    error:
                      code: unauthorized
                      message: API key is required
        '403':
          description: This endpoint is not enabled for this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                not-enabled:
                  summary: Endpoint not enabled
                  value:
                    error:
                      code: export_not_enabled
                      message: business is not authorized to use this endpoint
        '404':
          description: The campaign was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                campaign-not-found:
                  summary: Campaign not found
                  value:
                    error:
                      code: campaign_not_found
                      message: campaign not found
        '500':
          description: An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                internal:
                  summary: Internal error
                  value:
                    error:
                      code: internal_error
                      message: failed to add contacts to campaign
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: A machine-readable error code.
              examples:
                - invalid_email
            message:
              type: string
              description: A human-readable error description.
              examples:
                - 'invalid email format: not-an-email'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your Conversion API key. Found in **Settings > Integrations** in the
        dashboard. Format: `sk_live_<key_id>_<secret>`.

````