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

# Create campaign

> Creates a campaign draft, scheduled campaign, or immediate send when `sendNow` is true.



## OpenAPI

````yaml /openapi.json post /api/v1/campaigns
openapi: 3.1.0
info:
  title: Nudgen Developer API
  version: 1.0.0
  description: >-
    REST API for managing Nudgen contacts, campaigns, brand settings, and AI
    email drafts with Personal Access Token authentication.
servers:
  - url: https://nudgen.net
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Identity
  - name: Contacts
  - name: Campaigns
  - name: Brand settings
  - name: AI
paths:
  /api/v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create campaign
      description: >-
        Creates a campaign draft, scheduled campaign, or immediate send when
        `sendNow` is true.
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
            example:
              name: API launch test
              goal: Invite contacts to try Nudgen.
              subject: Try Nudgen
              html: <p>Ready to launch smarter email?</p>
              link: https://nudgen.net
              audienceType: manual
              audienceContactIds:
                - contact_id
      responses:
        '200':
          description: Campaign created
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign:
                    $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    CreateCampaignRequest:
      type: object
      required:
        - name
        - goal
        - subject
        - html
        - link
      properties:
        name:
          type: string
        goal:
          type: string
        subject:
          type: string
        html:
          type: string
        link:
          type: string
          format: uri
        audienceType:
          type: string
          enum:
            - all
            - tags
            - manual
          default: all
        audienceTags:
          type: array
          items:
            type: string
        audienceContactIds:
          type: array
          items:
            type: string
        sendNow:
          type: boolean
          default: false
        scheduledAt:
          type: string
          format: date-time
        personalizationMode:
          type: string
          enum:
            - 'off'
            - lead_description_intro
          default: 'off'
    Campaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
            - one-time
            - drip
        status:
          type: string
          enum:
            - draft
            - scheduled
            - sending
            - sent
            - stopped
        subject:
          type: string
        scheduledAt:
          type:
            - string
            - 'null'
          format: date-time
        sentAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
  responses:
    BadRequest:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The workspace cannot perform this write action
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: Personal Access Token created from Settings -> API Keys.

````