> ## 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.

# Create new Campaign

> Creates a new campaign with provided details. Campaign will be in `created` state until it is started/scheduled using respective apis.



## OpenAPI

````yaml /openapi.yml post /api/v1/campaign/
openapi: 3.1.1
info:
  title: DeliverymanAI API
  version: 1.0.0
  description: >-
    API documentation for DeliverymanAI, a Cold Email Management and Automation
    platform. This API provides endpoints for managing campaigns, contacts,
    email sequences, and related services.
servers:
  - url: https://api.deliveryman.ai
    description: Deliveryman API Server
security: []
paths:
  /api/v1/campaign/:
    post:
      tags:
        - Campaign
      summary: Create new Campaign
      description: >-
        Creates a new campaign with provided details. Campaign will be in
        `created` state until it is started/scheduled using respective apis.
      operationId: campaign_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCampaignAPI'
          description: Success
        '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':
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CampaignCreate:
      properties:
        workspace_id:
          title: Workspace Id
          type: integer
        campaign_data:
          $ref: '#/components/schemas/CampaignCreateData'
      required:
        - workspace_id
        - campaign_data
      title: CampaignCreate
      type: object
    GetCampaignAPI:
      type: object
      properties:
        uid:
          type: string
          description: Unique identifier of the campaign.
          maxLength: 255
        created_on:
          type: string
          format: date-time
          readOnly: true
          description: >-
            Date when the campaign was created. ISO format date string in UTC
            timezone.
        workspace_id:
          type:
            - integer
            - 'null'
          readOnly: true
          description: The ID of the workspace associated with the campaign.
        scheduled_start_datetime:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Datetime when the campaign is scheduled to start. ISO format date
            string in UTC timezone.
        settings:
          allOf:
            - $ref: '#/components/schemas/CampaignSettings'
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/StatusF69Enum'
          description: |-
            Current status of the campaign.

            * `creating` - Creating
            * `created` - Created
            * `scheduled` - Scheduled
            * `running` - Running
            * `paused` - Paused
            * `complete` - Complete
            * `cancelled` - Cancelled
            * `failed` - Failed
        bounces:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: Number of bounced emails in the campaign.
        campaign_paused:
          type: boolean
          description: Indicates whether the campaign is paused.
        campaign_paused_on:
          type:
            - string
            - 'null'
          format: date-time
          description: Datetime when the campaign was paused.
        is_generating_schedules:
          type: boolean
          description: Indicates if schedules are being generated for the campaign.
        is_deleting_schedules:
          type: boolean
          description: Indicates if schedules are being deleted for the campaign.
        archived:
          type: boolean
          description: Flag indicating if the campaign is archived.
        is_campaign_bounce_blocked:
          type: boolean
          description: Flag indicating if the campaign is bounce-blocked.
        started_running_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Datetime when the campaign started running. ISO format date string
            in UTC timezone.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Datetime when the campaign was completed. ISO format date string in
            UTC timezone.
        cancelled_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Datetime when the campaign was cancelled. ISO format date string in
            UTC timezone.
        selected_contact_lists:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
      required:
        - created_on
        - selected_contact_lists
        - settings
        - uid
        - workspace_id
    SimpleMessageResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    CampaignCreateData:
      properties:
        name:
          description: Campaign name, max 300 characters, cannot be empty
          maxLength: 300
          minLength: 1
          pattern: \S
          title: Name
          type: string
        reply_to_address:
          anyOf:
            - format: email
              type: string
            - type: 'null'
          default: null
          description: Valid email address or None
          nullable: true
          title: Reply To Address
          type: string
        daily_email_limit:
          description: Limit must be between 10 and 100
          maximum: 100
          minimum: 10
          title: Daily Email Limit
          type: integer
        skip_days:
          description: List of days to skip, max length 6.
          items:
            $ref: '#/components/schemas/SkipDaysEnum'
          maxItems: 6
          title: Skip Days
          type: array
        single_subject:
          description: Whether or not to include same subject across all campaign emails.
          title: Single Subject
          type: boolean
        scheduling_strategy:
          allOf:
            - $ref: '#/components/schemas/SchedulingStrategy94fEnum'
          description: >-
            Scheduling strategy to use for this campaign. Possible values are
            `smart-queue` (Balanced Mode), `no-followup-limit` (No Follow-up
            Limit Mode), `sequential` (Sequential Mode) and `single-message`. If
            campaign only has one email sequence, use `single-message`.
            Otherwise choose one from any of the remaining 3 modes.
          title: Scheduling Strategy
        from_time:
          description: >-
            Start time in strict HH:MM:SS format (24-hours clock). From and To
            times should have a gap of at least 3 hours.
          pattern: ^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$
          title: From Time
          type: string
        to_time:
          description: >-
            End time in strict HH:MM:SS format (24-hours clock). From and To
            times should have a gap of at least 3 hours.
          pattern: ^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$
          title: To Time
          type: string
        time_zone:
          description: Time zone string (e.g., 'UTC', 'America/New_York')
          title: Time Zone
          type: string
        add_unsub_link:
          description: Whether to include an unsubscribe link in all campaign emails.
          title: Add Unsub Link
          type: boolean
        unsub_link_type:
          allOf:
            - $ref: '#/components/schemas/UnsubLinkTypeEnum'
          description: >-
            Unsubscribe link type - can be 'custom' or 'auto'. Only valid if
            `add_unsub_link` is True.
          title: Unsub Link Type
        custom_unsub_text:
          description: >-
            Custom unsubscribe text for this campaign. Only valid if
            `unsub_link_type` is 'custom'. If `add_unsub_link` is not set or not
            using 'custom' mode you can simply pass an empty string.
          title: Custom Unsub Text
          type: string
        contact_list_uid:
          anyOf:
            - type: string
            - type: 'null'
          description: UID of the contact list to use in this campaign.
          title: Contact List Uid
        sending_domains:
          description: List of email sending domain IDs.
          items:
            type: integer
          minItems: 0
          title: Sending Domains
          type: array
        click_tracking_enabled:
          description: Whether or not link click tracking is enabled.
          title: Click Tracking Enabled
          type: boolean
        open_tracking_enabled:
          description: Whether or not email open tracking is enabled.
          title: Open Tracking Enabled
          type: boolean
        skip_dangerous_emails:
          description: Set True to skip dangerous lead emails.
          title: Skip Dangerous Emails
          type: boolean
        skip_disposable_emails:
          description: Set True to skip disposable lead emails.
          title: Skip Disposable Emails
          type: boolean
        skip_catchall_emails:
          description: Set True to skip catch-all lead emails.
          title: Skip Catchall Emails
          type: boolean
        skip_full_inbox_emails:
          description: Set True to skip lead emails with full inbox.
          title: Skip Full Inbox Emails
          type: boolean
        skip_invalid_emails:
          description: Set True to skip invalid lead emails.
          title: Skip Invalid Emails
          type: boolean
        forward_negative_emails:
          description: Set True to always forward negative replies.
          title: Forward Negative Emails
          type: boolean
        forward_netural_emails:
          description: Set True to always forward neutral replies.
          title: Forward Netural Emails
          type: boolean
      required:
        - name
        - daily_email_limit
        - single_subject
        - scheduling_strategy
        - from_time
        - to_time
        - time_zone
        - add_unsub_link
        - unsub_link_type
        - custom_unsub_text
        - contact_list_uid
        - sending_domains
        - click_tracking_enabled
        - open_tracking_enabled
        - skip_dangerous_emails
        - skip_disposable_emails
        - skip_catchall_emails
        - skip_full_inbox_emails
        - skip_invalid_emails
        - forward_negative_emails
        - forward_netural_emails
      title: CampaignCreateData
      type: object
    CampaignSettings:
      type: object
      properties:
        name:
          type: string
          description: The name of the email campaign.
          maxLength: 300
        reply_to_address:
          type:
            - string
            - 'null'
          description: Email address to which replies will be directed.
          maxLength: 254
        daily_email_limit:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: Maximum number of emails sent per day.
        skip_days:
          type: array
          items:
            $ref: '#/components/schemas/SkipDaysEnum'
          description: >-
            Days on which emails will not be sent. Maximum 6 days can be
            skipped. At least one day should be available

            for sending emails.
          readOnly: true
        single_subject:
          type: boolean
          description: >-
            Indicates if all messages in the campaign have the same subject
            line.
        scheduling_strategy:
          allOf:
            - $ref: '#/components/schemas/CampaignSettingsSchedulingStrategyEnum'
          description: |-
            Strategy for scheduling the email campaign.

            * `testing` - Test Mode
            * `sequential` - Sequential Mode
            * `no-followup-limit` - No Followup Limit Mode
            * `smart-queue` - Smart Queue Mode
            * `single-message` - Single Message Mode
        from_time:
          type:
            - string
            - 'null'
          format: time
          description: 'Start of the daily time window to send emails. Format: HH:MM:SS.'
        to_time:
          type:
            - string
            - 'null'
          format: time
          description: 'End of the daily time window to send emails. Format: HH:MM:SS.'
        time_zone:
          type:
            - string
            - 'null'
          description: Time zone for the email sending schedule.
          maxLength: 100
        add_unsub_link:
          type: boolean
          description: Flag to determine if an unsubscribe link should be added.
        unsub_link_type:
          type: string
          description: Type of unsubscribe link used ('custom' or 'auto').
          maxLength: 100
        custom_unsub_text:
          type: string
          description: Custom text for the unsubscribe link.
        click_tracking_enabled:
          type: boolean
          description: Flag to enable tracking of email link clicks.
        open_tracking_enabled:
          type: boolean
          description: Flag to enable tracking of email opens.
        skip_dangerous_emails:
          type: boolean
          description: Flag to skip emails from potentially dangerous domains.
        skip_disposable_emails:
          type: boolean
          description: Flag to skip emails from disposable email providers.
        skip_catchall_emails:
          type: boolean
          description: Flag to skip catch-all email addresses.
        skip_full_inbox_emails:
          type: boolean
          description: Flag to skip emails from addresses with full inboxes.
        skip_invalid_emails:
          type: boolean
          description: Flag to skip invalid email addresses.
        forward_negative_emails:
          type: boolean
          description: Always forward Negative replies.
        forward_netural_emails:
          type: boolean
          description: Always forward Neutral replies.
        sending_domains:
          type: array
          items:
            type: integer
          description: List of domain IDs used for sending campaign emails.
          readOnly: true
      required:
        - name
        - sending_domains
        - skip_days
    StatusF69Enum:
      enum:
        - creating
        - created
        - scheduled
        - running
        - paused
        - complete
        - cancelled
        - failed
      type: string
      description: |-
        * `creating` - Creating
        * `created` - Created
        * `scheduled` - Scheduled
        * `running` - Running
        * `paused` - Paused
        * `complete` - Complete
        * `cancelled` - Cancelled
        * `failed` - Failed
    SkipDaysEnum:
      enum:
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
        - Saturday
        - Sunday
      type: string
    SchedulingStrategy94fEnum:
      enum:
        - sequential
        - no-followup-limit
        - smart-queue
        - single-message
      type: string
    UnsubLinkTypeEnum:
      enum:
        - auto
        - custom
      type: string
    CampaignSettingsSchedulingStrategyEnum:
      enum:
        - testing
        - sequential
        - no-followup-limit
        - smart-queue
        - single-message
      type: string
      description: |-
        * `testing` - Test Mode
        * `sequential` - Sequential Mode
        * `no-followup-limit` - No Followup Limit Mode
        * `smart-queue` - Smart Queue Mode
        * `single-message` - Single Message Mode
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'Enter your API key in the format: X-Api-Key <your_key>'

````