MoEngage Campaigns API

Create, update, search, test, and publish Push and Email campaigns. The V5 draft lifecycle builds a campaign incrementally — create a draft, patch components, validate, test-send, then publish — with an Idempotency-Key header on every POST and PATCH. Includes campaign stats, reports, and archival.

OpenAPI Specification

moengage-campaign-draft-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: MoEngage Campaigns API
  version: '2025-11-20'
  description: |
    The Campaigns V5 API manages the draft campaign lifecycle — draft creation, incremental updates, validation, test sends, and post-publish management.

    **Note:** Campaign publishing is not yet supported in V5. To publish campaigns, use the V1 API (`PATCH /core-services/v1/campaigns/{campaign_id}`) in the interim.

    **Supported channels:**
    - Push (Android, iOS, Web)
    - Email

    **Supported delivery types:**
    - ONE_TIME
    - PERIODIC
    - EVENT_TRIGGERED
    - BUSINESS_EVENT_TRIGGERED
    - DEVICE_TRIGGERED (Push only)
    - LOCATION_TRIGGERED (Push only)
    - BROADCAST_LIVE_ACTIVITY (Push iOS only)

    **Campaign lifecycle:**

    1. **Create** - Start a draft with only the required fields (`channel`, `campaign_delivery_type`, `created_by`). Add content, audience, and scheduling incrementally across subsequent update calls.
    2. **Update** - Patch individual components as you refine the setup. Each submitted component is validated in full before the draft is updated.
    3. **Validate** - Check whether a draft would pass publish-time validation without committing any changes.
    4. **Test** - Send a test message to specific users from either a saved draft or inline content before going live.
    5. **Manage** - Pause, resume, or stop a live campaign. Search your workspace and retrieve lightweight metadata across all campaigns.

    **Campaign versioning** is optional per workspace:
    - When enabled, publishing an update to a live campaign creates a new document with an incremented `version_number`.
    - `campaign_id` is the stable identifier across all versions; each version has its own raw `id` (ObjectId).

    **Authentication header:** Pass your Workspace ID in the `MOE-APPKEY` request header, the same as in V1.
  contact:
    name: MoEngage Developer Team
    email: support@moengage.com
    url: https://developers.moengage.com

servers:
  - url: 'https://api-{dc}.moengage.com/'
    description: MoEngage Campaigns API Server
    variables:
      dc:
        default: '01'
        description: 'Data center (DC) segment in the hostname. Replace `OX` with your workspace DC (01–06 or 101). See [Data centers](/api/introduction#data-centers).'

security:
  - BasicAuth: []

components:
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: |
        Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.

        - **Username**: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at **Settings** > **Account** > **APIs** > **Workspace ID (earlier app id)**.
        - **Password**: On your MoEngage workspace, navigate to **Settings** → **Account** → **API keys** and click **Create new key**. The tab lists every API surface (Data, Segmentation, Push, Email, Campaigns, Templates, and more) and exposes per-resource actions. For Campaigns, ensure the **View**, **Create & Manage**, and **Create, Manage & Publish** checkboxes are selected.

        For more information on authentication and getting your credentials, refer to [Getting your credentials](/api/introduction#getting-your-credentials).

        Send the value in the `Authorization` header as `Basic` followed by Base64-encoding of `appkey:apisecret` (workspace ID and API key).
  
  parameters:
    MOE-APPKEY:
      name: MOE-APPKEY
      in: header
      required: true
      description: |
        Your MoEngage Workspace ID (App ID). Find it in the dashboard at **Settings** > **Account** > **APIs** > **Workspace ID**.
      schema:
        type: string
      example: "{{workspace_id}}"
    X-MOE-Request-Id:
      name: X-MOE-Request-Id
      in: header
      required: true
      description: |
        Correlates with `response_id`. Supply this header or `request_id` in the body; if both are set, they must match.
      schema:
        type: string
    Idempotency-Key:
      name: Idempotency-Key
      in: header
      required: false
      description: |
        UUID v4. Required on all `POST` and `PATCH` requests except `POST /v5/campaigns/{campaign_id}/validate`. Repeating the same key returns the same response body.
      schema:
        type: string
        format: uuid
    Idempotency-Key-Required:
      name: Idempotency-Key
      in: header
      required: true
      description: |
        UUID v4. Required on all `POST` and `PATCH` requests except `POST /v5/campaigns/{campaign_id}/validate`. Repeating the same key returns the same response body.
      schema:
        type: string
        format: uuid
    X-MOE-Scopes:
      name: X-MOE-Scopes
      in: header
      required: false
      description: |
        Caller's effective Campaigns permissions. When requests pass through the MoEngage IAM gateway, the gateway injects this header from the permissions tied to your API key, and the service treats it as the source of truth. The service reads only the `campaigns:` entry.

        Action vocabulary: `view` (read), `create_manage` (create and edit drafts), and `create_manage_publish` (reserved for future publish support). The hierarchy is `create_manage_publish` ⟹ `create_manage` ⟹ `view`.

        Required action by operation:
        - `PATCH /v5/campaigns/{campaign_id}` (component edits) requires `create_manage`.

        If your effective permissions do not satisfy the required action, the API returns `403`. Other V5 routes are not gated by this header in the current release.
      schema:
        type: string
      example: "campaigns:create_manage"

  schemas:
    # ==================== V5 Draft-First Envelopes ====================
    V5SuccessEnvelope:
      type: object
      properties:
        response_id: { type: string }
        type: { type: string, example: "campaign" }
        data: { type: object }
          
    V5ErrorEnvelope:
      type: object
      properties:
        response_id: { type: string }
        error:
          type: object
          properties:
            code: 
              type: string
              enum: [VALIDATION_FAILED, UNPROCESSABLE_ENTITY, BAD_REQUEST, RATE_LIMITED, UNAUTHORIZED, INTERNAL_ERROR, FORBIDDEN] 
            message: { type: string }
            target: { type: string }
            details:
              type: array
              items:
                type: object
                properties:
                  target: { type: string }
                  message: { type: string }
            request_id:
              type: string
              description: |
                The `request_id` from the originating request. Use this to correlate a failed response back to the specific call that triggered it, particularly useful in high-volume or retry scenarios.

                In V1, `request_id` appeared inside the `error` object. V5 preserves this field in the same location.

    # ==================== V5 Request Schemas ====================
    CampaignCreateV5Request:
      oneOf:
        - $ref: '#/components/schemas/PushCampaignCreateV5Request'
        - $ref: '#/components/schemas/EmailCampaignCreateV5Request'
      discriminator:
        propertyName: channel
        mapping:
          PUSH: '#/components/schemas/PushCampaignCreateV5Request'
          EMAIL: '#/components/schemas/EmailCampaignCreateV5Request'

    PushCampaignCreateV5Request:
      title: Push Campaign
      type: object
      description: |
        Request body for creating a Push campaign draft via `POST /v5/campaigns`.

        Only `channel`, `campaign_delivery_type`, and `created_by` are required. Optional components (`basic_details`, `campaign_content`, `segmentation_details`, and so on) can be included in the same request, or added later via `PATCH /v5/campaigns/{campaign_id}`.


        For full examples per delivery type, refer to `campaign_delivery_type` below. For the component-level schemas with conditional rules per template type, platform, and delivery type, refer to:
        - [Campaign content reference](/api/campaigns/campaign-content-reference) — `basic_details` and `campaign_content`.
        - [Audience and delivery reference](/api/campaigns/audience-scheduling-delivery-reference) — `trigger_condition`, `segmentation_details`, `scheduling_details`, `delivery_controls`, `conversion_goal_details`, `control_group_details`, `utm_params`, `campaign_audience_limit`, `advanced`, and `geofences`.
      required: [channel, campaign_delivery_type, created_by]
      properties:
        request_id: 
          type: string
          description: |
            A unique identifier for this campaign creation request.
            
            **Important:** After successful campaign creation, do not reuse this request_id for the next 1 hour. If campaign creation fails, you can immediately retry with the same request_id.
          example: "{{request_id}}"
        channel: 
          type: string
          enum: [PUSH]
          description: The campaign channel. One of `PUSH` or `EMAIL`.
        campaign_delivery_type: 
          type: string
          enum: [ONE_TIME, PERIODIC, EVENT_TRIGGERED, BUSINESS_EVENT_TRIGGERED, DEVICE_TRIGGERED, LOCATION_TRIGGERED]
          description: |
            The delivery type of the campaign.

            **Note:** `BROADCAST_LIVE_ACTIVITY` is not supported through the draft-based creation flow.

            For full request payloads per delivery type, see the code examples on this page.
        created_by: 
          type: string
          format: email
          description: The email ID of the user creating this campaign.
          example: "john.doe@example.com"
        basic_details: { $ref: '#/components/schemas/PushBasicDetailsV5' }
        trigger_condition: { $ref: '#/components/schemas/PushTriggerCondition' }
        campaign_content: { $ref: '#/components/schemas/PushCampaignContent' }
        segmentation_details: { $ref: '#/components/schemas/SegmentationDetails' }
        scheduling_details: { $ref: '#/components/schemas/SchedulingDetails' }
        delivery_controls: { $ref: '#/components/schemas/PushDeliveryControls' }
        advanced: { $ref: '#/components/schemas/AdvancedDetails' }
        conversion_goal_details: { $ref: '#/components/schemas/ConversionGoalDetails' }
        control_group_details: { $ref: '#/components/schemas/ControlGroupDetails' }
        utm_params: { $ref: '#/components/schemas/UTMParams' }
        campaign_audience_limit: { $ref: '#/components/schemas/CampaignAudienceLimit' }

    EmailCampaignCreateV5Request:
      title: Email Campaign
      type: object
      description: |
        Request body for creating an Email campaign draft via `POST /v5/campaigns`.

        Required fields are `channel`, `campaign_delivery_type`, and `created_by`. `connector` is required before the campaign can be published or sent for testing, but can be added later via `PATCH` (progressive creation). `campaign_content` can be added when the message content is ready.


        For the component-level schemas with conditional rules:
        - [Campaign content reference](/api/campaigns/campaign-content-reference) — `basic_details`, `campaign_content` (`html_content` and `custom_template_id`), `variation_details`, and `connector`.
        - [Audience and delivery reference](/api/campaigns/audience-scheduling-delivery-reference) — `trigger_condition`, `segmentation_details`, `scheduling_details`, `delivery_controls`, `conversion_goal_details`, `control_group_details`, `utm_params`, and `campaign_audience_limit`.
      required: [channel, campaign_delivery_type, created_by]
      properties:
        request_id: 
          type: string
          description: |
            A unique identifier for this campaign creation request.
            
            **Important:** After successful campaign creation, do not reuse this request_id for the next 1 day. If campaign creation fails, you can immediately retry with the same request_id.
          example: "{{request_id}}"
        channel: 
          type: string
          enum: [EMAIL]
          description: The campaign channel. One of `PUSH` or `EMAIL`.
        campaign_delivery_type: 
          type: string
          enum: [ONE_TIME, PERIODIC, EVENT_TRIGGERED, BUSINESS_EVENT_TRIGGERED]
          description: |
            The delivery type of the campaign.

            For full request payloads per delivery type, see the code examples on this page.
        created_by: 
          type: string
          format: email
          description: The email ID of the user creating this campaign.
          example: "john.doe@example.com"
        basic_details: { $ref: '#/components/schemas/EmailBasicDetailsV5' }
        trigger_condition: { $ref: '#/components/schemas/EmailTriggerCondition' }
        connector: { $ref: '#/components/schemas/Connector' }
        campaign_content: { $ref: '#/components/schemas/EmailCampaignContent' }
        segmentation_details: { $ref: '#/components/schemas/SegmentationDetails' }
        scheduling_details: { $ref: '#/components/schemas/SchedulingDetails' }
        delivery_controls: { $ref: '#/components/schemas/EmailDeliveryControls' }
        conversion_goal_details: { $ref: '#/components/schemas/ConversionGoalDetails' }
        control_group_details: { $ref: '#/components/schemas/ControlGroupDetails' }
        utm_params: { $ref: '#/components/schemas/UTMParams' }
        campaign_audience_limit: { $ref: '#/components/schemas/CampaignAudienceLimit' }

    CampaignPatchV5Request:
      description: Used for component-level edits on a campaign draft.
      oneOf:
        - $ref: '#/components/schemas/PushComponentPatchRequest'
        - $ref: '#/components/schemas/EmailComponentPatchRequest'

    PushComponentPatchRequest:
      title: Update Push Campaign Draft
      type: object
      description: |
        Update one or more components of a Push campaign draft. Only fields you include are changed,
        omitted fields retain their current values. When updating a nested field, include its complete
        parent object.

      properties:
        request_id:
          type: string
          description: A unique identifier for this update request.
          example: "{{request_id}}"
        channel:
          type: string
          enum: [PUSH]
          description: Must be `PUSH` for a Push update.
        campaign_delivery_type:
          type: string
          enum: [ONE_TIME, PERIODIC, EVENT_TRIGGERED, BUSINESS_EVENT_TRIGGERED, DEVICE_TRIGGERED, LOCATION_TRIGGERED, BROADCAST_LIVE_ACTIVITY]
          description: |
            The delivery type of the campaign being updated.

            **Note:** `BROADCAST_LIVE_ACTIVITY` is included in this enum for campaigns created via the V1 API or legacy paths. Draft creation via `POST /v5/campaigns` does not support `BROADCAST_LIVE_ACTIVITY`. A draft cannot be transitioned to a Live Activity campaign through V5.
        updated_by:
          type: string
          format: email
          description: |
            The email address of the user making this update, used for audit trail purposes.
            If omitted, the update is attributed to the authenticated API credential.
          example: "marketer@example.com"
        basic_details:
          $ref: '#/components/schemas/PushBasicDetailsV5'
        trigger_condition:
          $ref: '#/components/schemas/PushTriggerCondition'
        campaign_content:
          $ref: '#/components/schemas/PushCampaignContent'
        segmentation_details:
          $ref: '#/components/schemas/SegmentationDetails'
        scheduling_details:
          $ref: '#/components/schemas/SchedulingDetails'
        delivery_controls:
          $ref: '#/components/schemas/PushDeliveryControls'
        advanced:
          $ref: '#/components/schemas/AdvancedDetails'
        conversion_goal_details:
          $ref: '#/components/schemas/ConversionGoalDetails'
        control_group_details:
          $ref: '#/components/schemas/ControlGroupDetails'
        utm_params:
          $ref: '#/components/schemas/UTMParams'
        campaign_audience_limit:
          allOf:
            - $ref: '#/components/schemas/CampaignAudienceLimit'
          description: |
            Configuration for capping how many users this campaign can reach. **Flag-gated feature** — must be enabled for your workspace by your MoEngage account team before use.

    EmailComponentPatchRequest:
      title: Update Email Campaign Draft
      type: object
      description: |
        Update one or more components of an Email campaign draft. Only fields you include are changed,
        omitted fields retain their current values. When updating a nested field, include its complete
        parent object.

      properties:
        request_id:
          type: string
          description: A unique identifier for this update request.
          example: "{{request_id}}"
        channel:
          type: string
          enum: [EMAIL]
          description: Must be `EMAIL` for an Email update.
        campaign_delivery_type:
          type: string
          enum: [ONE_TIME, PERIODIC, EVENT_TRIGGERED, BUSINESS_EVENT_TRIGGERED]
          description: The delivery type of the campaign being updated.
        updated_by:
          type: string
          format: email
          description: |
            The email address of the user making this update, used for audit trail purposes.
            If omitted, the update is attributed to the authenticated API credential.
          example: "marketer@example.com"
        basic_details:
          $ref: '#/components/schemas/EmailBasicDetailsV5'
        connector:
          $ref: '#/components/schemas/Connector'
        trigger_condition:
          $ref: '#/components/schemas/EmailTriggerCondition'
        campaign_content:
          $ref: '#/components/schemas/EmailCampaignContent'
        segmentation_details:
          $ref: '#/components/schemas/SegmentationDetails'
        scheduling_details:
          $ref: '#/components/schemas/SchedulingDetails'
        delivery_controls:
          $ref: '#/components/schemas/EmailDeliveryControls'
        advanced:
          $ref: '#/components/schemas/AdvancedDetails'
        conversion_goal_details:
          $ref: '#/components/schemas/ConversionGoalDetails'
        control_group_details:
          $ref: '#/components/schemas/ControlGroupDetails'
        utm_params:
          $ref: '#/components/schemas/UTMParams'
        campaign_audience_limit:
          allOf:
            - $ref: '#/components/schemas/CampaignAudienceLimit'
          description: |
            Configuration for capping how many users this campaign can reach. **Flag-gated feature** — must be enabled for your workspace by your MoEngage account team before use.

    PublishCampaignRequest:
      title: Publish Campaign Patch
      type: object
      required: [status]
      properties:
        request_id: 
          type: string
          description: A unique identifier for this update request.
        status:
          type: string
          description: |
            Reserved for future use. Campaign publishing is not yet supported in V5. Do not set this field.


    CampaignStatusV5Request:
      type: object
      description: Changes the status of a single published campaign. One campaign ID per request.
      required: [action]
      properties:
        request_id:
          type: string
          description: |
            A client-supplied identifier for this status change request, echoed back as `response_id` so you can correlate the request and response. This is not a deduplication key — to make a request idempotent, use the `Idempotency-Key` header. Replaying the same `Idempotency-Key` returns the original response.
        action:
          type: string
          enum: [STOP, PAUSE, RESUME]
          description: |
            Lifecycle action for an already published or scheduled campaign.

            Each action applies only to specific delivery types and requires the campaign to be in a valid source state:

            | Action | Supported delivery types | Valid source states |
            | :--- | :--- | :--- |
            | `STOP` | `ONE_TIME` | `ACTIVE`, `SCHEDULED`, `PAUSED`, `SENDING` |
            | `PAUSE` | `PERIODIC`, `EVENT_TRIGGERED` | `ACTIVE`, `SCHEDULED`, `SENDING` |
            | `RESUME` | `PERIODIC`, `EVENT_TRIGGERED` | `PAUSED` |

            <Note>
             `STOP` cannot be used on Periodic campaigns. `PAUSE` and `RESUME` cannot be used on One-time campaigns.
            </Note>


    SearchV5Request:
      type: object
      required: [limit, page]
      properties:
        request_id:
          type: string
          description: |
            An optional unique identifier for this search request (UUID v4 recommended).

            - In V1, `request_id` was required on every search call. In V5, it is optional.
            - Providing it is recommended for traceability and debugging. MoEngage support can use the value to locate the specific request in server logs.
          example: "{{request_id}}"
        campaign_fields: { $ref: '#/components/schemas/CampaignSearchFieldsV5' }
        include_child_campaigns:
          type: boolean
          default: false
          description: |
            When `true`, includes child campaigns in results. Defaults to `false`.

            Child campaign types included:
            - **Periodic children:** Carry `parent_id` in the response.
            - **Flow-node campaigns:** Carry `flow_id` and `flow_name` in the response.

        include_archive_campaigns:
          type: boolean
          default: false
          description: |
            When `true`, includes campaigns in `ARCHIVED` status in search results.
            By default, archived campaigns are excluded even if `ARCHIVED` is not in
            `campaign_fields.status`.

            Defaults to `false`.

        limit:
          type: integer
          description: |
            The number of campaigns to return per page.

            **Maximum:** 15. The response does not include a `total_count` field - to determine
            the total number of results, keep paginating until a response returns fewer items
            than `limit`.
          minimum: 1
          maximum: 15
          example: 10
        page:
          type: integer
          description: |
            The page number to retrieve (1-indexed).

            For example, with 200 campaigns and a limit of 10, there are 20 pages.
          minimum: 1
          example: 1
          
    CampaignSearchFieldsV5:
      type: object
      description: |
        Filter criteria for searching campaigns.

        The following filter field names changed from V1 to V5:
        - `id` (V1, string) is `ids` in V5 (array of strings). Pass a single-element array to replicate V1 single-ID filtering.
        - `delivery_type` (V1) is `campaign_delivery_type` in V5.

        All other V1 filter fields (`channels`, `created_by`, `created_date`, `name`, `status`, `tags`) use the same names in V5.
      properties:
        ids:
          type: array
          items:
            type: string
          description: |
            Filter by one or more campaign IDs.

            In V1, this field was `id` (a single string). In V5, it is `ids` (an array). For single-campaign retrieval, `GET /v5/campaigns/{campaign_id}` is the preferred endpoint.

          example: ["64a1b2c3d4e5f6a7b8c9d0e1"]
        channels:
          type: array
          items:
            type: string
            enum: [EMAIL, PUSH]
          description: Include campaigns for any of these channels.
          example: ["PUSH", "EMAIL"]
        created_by:
          type: array
          items:
            type: string
            format: email
          description: Include campaigns created by any of these users (email addresses).
          example: ["marketer@example.com"]
        created_date:
          type: object
          description: Filter campaigns by creation date range.
          properties:
            from_date:
              type: string
              format: date-time
              description: Start of the creation date range (ISO 8601 format).
              example: "2024-01-01T00:00:00"
            to_date:
              type: string
              format: date-time
              description: End of the creation date range (ISO 8601 format).
              example: "2024-12-31T23:59:59"
        campaign_delivery_type:
          type: array
          items:
            type: string
            enum: [ONE_TIME, PERIODIC, EVENT_TRIGGERED, BUSINESS_EVENT_TRIGGERED, DEVICE_TRIGGERED, LOCATION_TRIGGERED]
          description: |
            Include campaigns with any of these delivery types.

            In V1, this field was `delivery_type`. In V5, it is `campaign_delivery_type`.
          example: ["ONE_TIME", "PERIODIC"]
        name:
          type: string
          description: Filter campaigns by name. Partial matches are supported.
          example: "Summer Sale"
        status:
          type: array
          items:
            type: string
            enum: [DRAFT, ACTIVE, SCHEDULED, PAUSED, SENT, SENDING, STOPPED, ARCHIVED]
          description: |
            Include campaigns in any of these statuses.

            Drafts are only returned when `DRAFT` is explicitly included here.

        tags:
          type: array
          items:
            type: string
          description: Include campaigns that have any of these tags.
          example: ["promotional", "seasonal"]
        version_number:
          type: integer
          description: |
            Filter by campaign version. Only applies when campaign versioning is enabled for your workspace. Omit to include all versions.


    MetaV5Request:
      type: object
      required: [limit, page]
      properties:
        request_id:
          type: string
          description: A unique identifier for this metadata retrieval request.
          example: "{{request_id}}"
        campaign_fields: { $ref: '#/components/schemas/CampaignMetaSearchFieldsV5' }
        include_child_campaigns:
          type: boolean
          default: false
          description: |
            When `true`, returns child campaign metadata for periodic campaigns.
            
            Activates the following response fields on each campaign object:
            - `total_child_campaigns` - number of child campaigns (present on the parent campaign).
            - `parent_campaign_id` - the parent campaign's ID (present on each child campaign).
            
            Defaults to `false`.
        limit: 
          type: integer
          description: |
            The number of campaigns to display per page.
            
            **Maximum:** 15. The response does not include a `total_count` field - to determine the total number of results, keep paginating until a response returns fewer items than `limit`.
          minimum: 1
          maximum: 15
          example: 15
        page: 
          type: integer
          description: |
            The page number to retrieve.
            
            For example, if there are 200 campaigns and the limit is 10, there will be 20 pages.
          minimum: 1
          example: 1

    CampaignMetaSearchFieldsV5:
      type: object
      description: Filter criteria for retrieving campaign metadata.
      properties:
        id:
          type: string
          description: |
            The unique identifier of the campaign to retrieve.

          example: "{{campaign_id}}"
        channels:
          type: array
          items:
            type: string
            enum: [EMAIL, PUSH, SMS, WHATSAPP, FACEBOOK, 'GOOGLE ADS', CONNECTORS]
          description: |
            Include campaigns for any of these channels.

          example: ["PUSH", "EMAIL"]
        created_by:
          type: array
          items:
            type: string
            format: email
          description: Include campaigns created by any of these users (email addresses).
          example: ["user@example.com"]
        created_date:
          type: object
          description: Filter campaigns by creation date range.
          properties:
            from_date:
              type: string
              format: date-time
              description: Start of the creation date range (ISO 8601 format).
              example: "2024-01-01T00:00:00"
            to_date:
              type: string
              format: date-time
              description: End of the creation date range (ISO 8601 format).
              example: "2024-12-31T23:59:59"
        delivery_type:
          type: string
          enum: [ONE_TIME, PERIODIC, EVENT_TRIGGERED, BUSINESS_EVENT_TRIGGERED, DEVICE_TRIGGERED, LOCATION_TRIGGERED]
          description: |
            Filter campaigns by delivery type.

        name:
          type: string
          description: Filter campaigns by name. Partial matches are supported.
          example: "Summer Sale"
        status:
          type: array
          items:
            type: string
            enum: [DRAFT, SCHEDULED, ACTIVE, PAUSED, SENT, SENDING, STOPPED, ARCHIVED]
          description: Include campaigns in any of these statuses.
        tags:
          type: array
          items:
            type: string
          description: Include campaigns that have any of these tags.
          example: ["promotional", "seasonal"]

    TestV5Request:
      oneOf:
        - $ref: '#/components/schemas/TestV5PushRequest'
        - $ref: '#/components/schemas/TestV5EmailRequest'
      discriminator:
        propertyName: channel
        mapping:
          PUSH: '#/components/schemas/TestV5PushRequest'
          EMAIL: '#/components/schemas/TestV5EmailRequest'

    TestV5PushRequest:
      title: Push
      type: object
      description: |
        Push test request. Supports two modes:

        - **Inline mode**: Supply `channel` and `campaign_content` directly. Nothing is stored on the server.
        - **Draft mode**: Supply `draft_id` to load content from a saved DRAFT campaign. By default, the server sends one test per platform, locale, and variation defined in the draft. Use `test_campaign_meta.platform`, `locale_name`, or `variation` to narrow the send.

        **Conditional required fields:** `test_campaign_meta` is always required. Inline mode additionally requires `channel` and `campaign_content`. Draft mode additionally requires `draft_id`. These per-mode requirements are enforced by the API but cannot be expressed in the `required` array, which lists only the always-required `test_campaign_meta`.
      required: [test_campaign_meta]
      properties:
        request_id:
          type: string
          description: Optional unique identifier for this test request (UUID v4 recommended). Used for idempotency.
          example: "{{request_id}}"
        channel:
          type: string
          enum: [PUSH]
          description: Required for inline mode. Must be `PUSH`.
        draft_id:
          type: string
          description: >-
            Required for draft mode. Raw 24-character ObjectId of the saved DRAFT campaign to test.
            Obtain this value from the `id` returned when the draft was created. Mutually exclusive with `channel` and `campaign_content`.
          example: "{{campaign_id}}"
        basic_details:
          $ref: '#/components/schemas/PushBasicDetailsV5'
        campaign_content:
          $ref: '#/components/schemas/PushCampaignContent'
        personalization_details:
          $ref: '#/components/schemas/PersonalizationDetails'
        test_campaign_meta:
          $ref: '#/components/schemas/TestCampaignMetaV5'

    TestV5EmailRequest:
      title: Email
      type: object
      description: |
        Email test request. Supports two modes:

        - **Inline mode**: Supply `channel`, `basic_details`, `connector`, and `campaign_content` directly. Nothing is stored on the server.
        - **Draft mode**: Supply `draft_id` to load content from a saved DRAFT campaign. By default, the server sends one test per locale and variation defined in the draft. Use `test_campaign_meta.locale_name` or `variation` to narrow the send.

        **Conditional required fields:** `test_campaign_meta` is always required. Inline mode additionally requires `channel`, `basic_details`, `connector`, and `campaign_content`. Draft mode additionally requires `draft_id`. These per-mode requirements are enforced by the API but cannot be expressed in the `required` array, which lists only th

# --- truncated at 32 KB (231 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/moengage/refs/heads/main/openapi/moengage-campaign-draft-openapi.yml