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

# Create and trigger a Campaign

> Create and trigger a Campaign for a Cohort



## OpenAPI

````yaml /swagger.yml post /public/campaigns
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create and trigger a Campaign
      description: Create and trigger a Campaign for a Cohort
      operationId: PublicCampaignsController_createAndTriggerCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAndTriggerCampaignRequest'
      responses:
        '201':
          description: The created campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    CreateAndTriggerCampaignRequest:
      type: object
      required:
        - sender
        - listName
        - mediaUrls
        - body
      properties:
        sender:
          type: string
          description: >-
            The Clerk phone number or identifier from which campaign messages
            will be sent
          example: '+1415456789'
        provider:
          $ref: '#/components/schemas/InboxProvider'
          description: The provider to send the message from
          example: whatsapp
        listName:
          type: string
          description: >-
            The name of the list containing the contacts the campaign will be
            sent to
          example: PremiumTierSubscribers
        mediaUrls:
          type: array
          description: The media URLs to send with the campaign message
          items:
            type: string
          example:
            - https://example.com/image.jpg
        body:
          type: string
          description: The message text
          example: Hello, world!
        timestamp:
          type: string
          format: date-time
          description: Timestamp for when scheduled campaign messages will be sent
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
        name:
          type: string
          description: An optional name for the campaign
          example: Sale Reminder
    CampaignResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/CampaignObject'
    InboxProvider:
      type: string
      enum:
        - twilio
        - bandwidth
        - msteams
        - other
        - non_voip
        - whatsapp
        - telnyx
        - webex
        - rcs
    CampaignObject:
      type: object
      required:
        - id
        - body
        - teamId
        - userId
        - name
        - inboxId
        - status
        - created
        - updated
        - error
      properties:
        id:
          type: number
          description: The associated Campaign ID
          example: 1
          readOnly: true
        body:
          type: string
          description: The message text
          example: Hello, world!
        teamId:
          type: string
          description: The ID of the team the resource belongs to
          example: '1'
          readOnly: true
        userId:
          type: string
          description: The ID of the user who created the resource
          example: '1'
          readOnly: true
        name:
          type: string
          description: The name of the campaign
          example: October Sale Reminder
        inboxId:
          type: string
          description: The associated Inbox ID
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
        status:
          type: string
          description: The status of the campaign
          enum:
            - ok
            - scheduled
            - planned
            - running
            - error
          example: scheduled
        created:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
        updated:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
        error:
          type: string
          description: Details about any error that occurred
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````