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

# Change Campaign Contact List

> Updates campaign to use a different set of contact lists, replacing the current ones. An address present in more than one list is only contacted once. This request starts a background task and might take a few minutes for changes to be reflected depending on the size of contact list. Campaign will be moved to `creating` status until done. Returns status code `202` upon successfully starting the update task. This operation can only be peformed on campaigns in `created` status.



## OpenAPI

````yaml /openapi-v1.yml patch /api/v1/campaign/change-contact-list/
openapi: 3.1.1
info:
  title: DeliverymanAI API V1
  version: 1.0.0
  description: >-
    API documentation for version 1 of the DeliverymanAI API. These endpoints
    drive campaigns, contact lists, leads and email sequences from your own
    code.


    V1 is in maintenance: it keeps working and existing integrations do not need
    to change, but new features are only added to V2. If you are starting a new
    integration, use V2.


    V1 and V2 share the same API keys, sent in the `X-Api-Key` header.
servers:
  - url: https://api.deliveryman.ai
    description: Deliveryman API Server
security: []
paths:
  /api/v1/campaign/change-contact-list/:
    patch:
      tags:
        - Campaign
      summary: Change Campaign Contact List
      description: >-
        Updates campaign to use a different set of contact lists, replacing the
        current ones. An address present in more than one list is only contacted
        once. This request starts a background task and might take a few minutes
        for changes to be reflected depending on the size of contact list.
        Campaign will be moved to `creating` status until done. Returns status
        code `202` upon successfully starting the update task. This operation
        can only be peformed on campaigns in `created` status.
      operationId: campaign_change_contact_list_partial_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedChangeCampaignContactListRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedChangeCampaignContactListRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedChangeCampaignContactListRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeCampaignContactListResponse'
          description: Processing Started
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: curl
          source: >-
            curl -X PATCH
            "https://api.deliveryman.ai/api/v1/campaign/change-contact-list/" \
              -H "X-Api-Key: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "campaign_uid": "cmp_4b1f7a92c3d84e05",
                "contact_list_uid": "cl_2f9a4c71b8e6d305",
                "contact_list_uids": []
              }'
components:
  schemas:
    PatchedChangeCampaignContactListRequest:
      properties:
        campaign_uid:
          description: UID of campaign to update.
          title: Campaign Uid
          type: string
        contact_list_uid:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          deprecated: true
          description: >-
            Deprecated, use `contact_list_uids` instead. UID of contact list to
            use.
          title: Contact List Uid
        contact_list_uids:
          anyOf:
            - items:
                type: string
              maxItems: 10
              type: array
            - type: 'null'
          default: null
          description: >-
            UIDs of the contact lists to use. Replaces the campaign's current
            lists. A campaign can target up to 10 lists.
          title: Contact List Uids
      required:
        - campaign_uid
      title: ChangeCampaignContactListRequest
      type: object
    ChangeCampaignContactListResponse:
      type: object
      properties:
        message:
          type: string
        campaign_uid:
          type: string
        contact_list_uid:
          type: string
        contact_list_uids:
          type: array
          items:
            type: string
        task_started_on:
          type: string
          format: date-time
      required:
        - campaign_uid
        - contact_list_uid
        - contact_list_uids
        - message
        - task_started_on
    SimpleMessageResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Your API key. In the dashboard, go to Integrations and open Deliveryman
        API Keys to create one.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.