> ## 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 Campaign Members

> Add up to 200 members to a custom campaign by email, creating contacts that do not exist yet. Adding is an idempotent upsert: a contact already in the campaign has its status updated instead of being added twice.

Status progression is forward-only for existing members; requesting their current or an earlier status leaves it unchanged. Set a status by `statusId` or `status` from `GET /v2/campaigns/{campaignId}`, or omit both to use the campaign type's first status. Members are processed independently, so one can fail while the rest of the batch succeeds.



## OpenAPI

````yaml /openapi.json post /v2/campaigns/{campaignId}/members/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}/members/batch:
    post:
      summary: Batch Add Campaign Members
      description: >-
        Add up to 200 members to a custom campaign by email, creating contacts
        that do not exist yet. Adding is an idempotent upsert: a contact already
        in the campaign has its status updated instead of being added twice.


        Status progression is forward-only for existing members; requesting
        their current or an earlier status leaves it unchanged. Set a status by
        `statusId` or `status` from `GET /v2/campaigns/{campaignId}`, or omit
        both to use the campaign type's first status. Members are processed
        independently, so one can fail while the rest of the batch succeeds.
      operationId: batchAddCampaignMembers
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The Conversion campaign id, as returned by `GET /v2/campaigns`.
          examples:
            campaign:
              value: b7c8d9e0-f1a2-3456-bcde-f01234567890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - members
              properties:
                members:
                  type: array
                  minItems: 1
                  maxItems: 200
                  description: An array of members to add to the campaign.
                  items:
                    type: object
                    required:
                      - email
                    properties:
                      email:
                        type: string
                        format: email
                        description: >-
                          The member's email address, normalized (trimmed and
                          lowercased) before matching. An invalid email fails
                          that member's row with `invalid_email` and creates no
                          contact.
                        examples:
                          - jane@example.com
                      statusId:
                        type: string
                        format: uuid
                        description: >-
                          The campaign status id to place the member in, as
                          returned by `GET /v2/campaigns/{campaignId}`. Takes
                          precedence over `status`. An id that is not a status
                          of the campaign's type fails that member's row.
                        examples:
                          - 8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b1c
                      status:
                        type: string
                        description: >-
                          The campaign status name, case-insensitive. Used only
                          when `statusId` is not set.
                        examples:
                          - Attended
            examples:
              add-members:
                summary: Add members with different statuses
                value:
                  members:
                    - email: jane@example.com
                    - email: john@example.com
                      status: Attended
                    - email: sam@example.com
                      statusId: 8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b1c
      responses:
        '200':
          description: >-
            Batch processed. Check the counts and each result for per-member
            success or failure.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    required:
                      - processed
                      - succeeded
                      - failed
                      - results
                    properties:
                      processed:
                        type: integer
                        description: The total number of members in the batch.
                      succeeded:
                        type: integer
                        description: The number of members added or updated.
                      failed:
                        type: integer
                        description: The number of members that failed.
                      results:
                        type: array
                        description: >-
                          An array of result objects in the same order as the
                          input `members` array.
                        items:
                          type: object
                          required:
                            - email
                            - success
                          properties:
                            email:
                              type: string
                              description: The member's email address from the request.
                            success:
                              type: boolean
                              description: >-
                                `true` if the member was successfully added or
                                updated.
                            campaignMemberId:
                              type: string
                              format: uuid
                              description: The campaign member id. Present on success.
                            contactId:
                              type: string
                              format: uuid
                              description: >-
                                The id of the member's contact, created if it
                                did not exist. Present on success.
                            error:
                              type: string
                              description: >-
                                A machine-readable error code. Present on
                                failure: `invalid_email`,
                                `invalid_campaign_status`, or `upsert_failed`.
                            message:
                              type: string
                              description: >-
                                A human-readable error description. Present on
                                failure.
              examples:
                mixed-results:
                  summary: Partial success
                  value:
                    data:
                      processed: 2
                      succeeded: 1
                      failed: 1
                      results:
                        - email: jane@example.com
                          success: true
                          campaignMemberId: 0a1b2c3d-4e5f-4a6b-8c7d-8e9f0a1b2c3d
                          contactId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                        - email: john@example.com
                          success: false
                          error: invalid_campaign_status
                          message: status is not valid for this campaign
        '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
        '404':
          description: The requested resource 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 campaign members
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>`.

````