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

# Create Campaign

> Create a new campaign in DRAFT status.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/campaigns
openapi: 3.1.0
info:
  title: wazzapi Public API
  description: >-
    Public API surface for external API-key clients. Only stable /api/v1
    endpoints are included.


    ## Webhook deliveries

    This reference also includes the webhook requests Wazzapi sends to your
    endpoint for incoming messages, message status updates, and device status
    changes. See the `Incoming webhooks` section in the sidebar for headers,
    payload fields, and concrete examples.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Incoming webhooks
    description: >-
      POST deliveries that Wazzapi sends to your webhook endpoint after you
      subscribe to supported events. Verify the signature against the raw body
      and return a 2xx response quickly.
paths:
  /api/v1/campaigns:
    post:
      tags:
        - campaigns
      summary: Create Campaign
      description: Create a new campaign in DRAFT status.
      operationId: create_campaign_api_v1_campaigns_post
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CampaignCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Description
        whatsapp_account_id:
          type: string
          format: uuid
          title: Whatsapp Account Id
        template_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Template Id
        message_type:
          type: string
          title: Message Type
          default: text
        custom_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Message
        message_payload:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Message Payload
        recipient_type:
          $ref: '#/components/schemas/RecipientType'
        recipient_group_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Recipient Group Ids
        recipient_contact_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Recipient Contact Ids
        scheduled_for:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduled For
      type: object
      required:
        - name
        - whatsapp_account_id
        - recipient_type
      title: CampaignCreate
      description: Request to create a new campaign.
    CampaignResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        whatsapp_account_id:
          type: string
          format: uuid
          title: Whatsapp Account Id
        template_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Template Id
        message_type:
          type: string
          title: Message Type
          default: text
        custom_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Message
        message_payload:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Message Payload
        recipient_type:
          type: string
          title: Recipient Type
        recipient_group_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Recipient Group Ids
        recipient_contact_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Recipient Contact Ids
        scheduled_for:
          anyOf:
            - type: string
            - type: 'null'
          title: Scheduled For
        status:
          type: string
          title: Status
        total_recipients:
          type: integer
          title: Total Recipients
        messages_sent:
          type: integer
          title: Messages Sent
        messages_delivered:
          type: integer
          title: Messages Delivered
        messages_read:
          type: integer
          title: Messages Read
        messages_failed:
          type: integer
          title: Messages Failed
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
        cancelled_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Cancelled At
        failed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Failed At
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - id
        - name
        - whatsapp_account_id
        - recipient_type
        - status
        - total_recipients
        - messages_sent
        - messages_delivered
        - messages_read
        - messages_failed
        - created_at
        - updated_at
      title: CampaignResponse
      description: Full campaign detail response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RecipientType:
      type: string
      enum:
        - all
        - group
        - custom
      title: RecipientType
      description: Campaign recipient selection mode.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````