title: Marketing Campaign Configuration
type: object
required:
  - name
  - template_submission_uuid
  - audience
  - destination
properties:
  name:
    type: string
    minLength: 1
    maxLength: 255
    example: Weekend offers
  template_submission_uuid:
    type: string
    format: uuid
    description: The UUID of a linked, approved marketing submission for this merchant’s connected WhatsApp account.
  audience:
    oneOf:
      - type: object
        required:
          - type
        properties:
          type:
            type: string
            const: all_eligible
          tier_uuids:
            type: array
            maxItems: 0
            items:
              type: string
              format: uuid
        additionalProperties: false
      - type: object
        required:
          - type
          - tier_uuids
        properties:
          type:
            type: string
            const: selected_tiers
          tier_uuids:
            type: array
            items:
              type: string
              format: uuid
            uniqueItems: true
            description: Complete list of active loyalty tier UUIDs owned by the merchant. UUID comparison ignores case.
            minItems: 1
        additionalProperties: false
  destination:
    oneOf:
      - type: object
        required:
          - type
          - web_url
        properties:
          type:
            type: string
            const: web_url
          web_url:
            type: string
            format: uri
            pattern: "^[Hh][Tt][Tt][Pp][Ss]://"
            maxLength: 2048
            example: https://example.com/offers
          message_automation_uuid:
            type: "null"
        additionalProperties: false
      - type: object
        required:
          - type
          - message_automation_uuid
        properties:
          type:
            type: string
            const: message_automation
          web_url:
            type: "null"
          message_automation_uuid:
            type: string
            format: uuid
            description: UUID of an active WhatsApp automation owned by the merchant.
        additionalProperties: false
x-tags:
  - Models
