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

# Create Campaign

> Creates a campaign.

<Note>
  Call this endpoint on the campaigns service: `https://campaigns.pingmee.co.il`.
</Note>

Creates a campaign that runs a workflow. Recipients come from tags or an Excel list. Each choice shows only its own fields.


## OpenAPI

````yaml POST /campaigns
openapi: 3.1.0
info:
  title: Pingmee API
  description: A complete guide to Pingmee micro service architecture.
  version: 1.0.0
servers:
  - url: https://api.pingmee.co.il
security:
  - cookieAuth: []
    ApiKeyAuth: []
paths:
  /campaigns:
    servers:
      - url: https://campaigns.pingmee.co.il
        description: Campaigns service
    post:
      summary: Create campaign
      description: Creates a campaign.
      requestBody:
        required: true
        description: Campaign to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaign'
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    example: Campaign '1710000000000' created.
                additionalProperties: false
        '500':
          description: Missing or empty name, or the campaign could not be saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateCampaign:
      unevaluatedProperties: false
      allOf:
        - type: object
          required:
            - id
            - name
            - folderId
            - contentType
            - workflowId
            - workflowName
            - whenToSendMessage
            - associatedToBusinessId
            - isActive
          properties:
            id:
              type: string
              description: Campaign id.
            name:
              type: string
              description: Campaign name.
            description:
              type: string
              description: Campaign description.
            contentType:
              type: string
              enum:
                - triggerWorkflow
              description: Runs a workflow.
            workflowId:
              type: string
              description: Workflow id.
            workflowName:
              type: string
              description: Workflow name.
            folderId:
              type: string
              description: >-
                Campaign folder id. In the Pingmee app this is the path segment
                in `https://chat.pingmee.co.il/dashboard/campaigns/{folderId}`.
              example: '1785185339087'
            whenToSendMessage:
              type: string
              enum:
                - now
                - future
              description: now sends immediately. future sends at scheduledAt.
            scheduledAt:
              type: number
              description: >-
                Send time in Unix milliseconds. Required when whenToSendMessage
                is future.
            audienceCountry:
              type: string
              description: ISO country code for numbers without a calling code.
              example: IL
            associatedToBusinessId:
              type: string
              description: Phone number id the campaign sends from.
            isActive:
              type: boolean
              description: Whether the campaign is active.
        - oneOf:
            - $ref: '#/components/schemas/CampaignAudienceTags'
            - $ref: '#/components/schemas/CampaignAudienceExcel'
          discriminator:
            propertyName: source
            mapping:
              tags: '#/components/schemas/CampaignAudienceTags'
              excel: '#/components/schemas/CampaignAudienceExcel'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    CampaignAudienceTags:
      type: object
      title: Tags
      required:
        - source
        - conversationTags
      properties:
        source:
          type: string
          enum:
            - tags
          description: Send to tagged conversations.
        conversationTags:
          type: array
          description: Tags.
          items:
            $ref: '#/components/schemas/ConversationTag'
    CampaignAudienceExcel:
      type: object
      title: Excel
      required:
        - source
        - customerList
      properties:
        source:
          type: string
          enum:
            - excel
          description: Send to a list of phone numbers.
        customerList:
          type: array
          description: Recipients.
          items:
            type: object
            required:
              - phoneNumberId
            properties:
              customerName:
                type: string
              phoneNumberId:
                type: string
                description: Phone number, including country code.
              countryCode:
                type: string
            additionalProperties: false
    ConversationTag:
      type: object
      required:
        - id
        - title
        - color
        - associatedTo
      properties:
        id:
          type: string
          description: Unique identifier of the tag
        title:
          type: string
          description: Human-readable tag title
        color:
          type: string
          description: Tag color (hex, rgb, or named color)
        associatedTo:
          type: string
          description: Business or account the tag is associated with
      additionalProperties: false
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: header
      name: Cookie
      description: Personal access token from Pingmee Settings → Developer Tools
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Business API key from Pingmee Settings → Developer Tools

````

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