> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-analytics-query-api-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Campaign (V5)

> Validates whether a draft would pass publish-time checks (`DRAFT_PUBLISH`) without making any changes to the draft.

The request body is the same regardless of channel — all campaign data is read from the saved draft identified by `campaign_id` in the path, so there is no channel-specific payload.


<Info>
  You do not need an idempotency key for this endpoint.
</Info>

#### Rate Limits

| Rate Limit Name              | Rate Limit                                                                           |
| :--------------------------- | :----------------------------------------------------------------------------------- |
| Validate campaign per second | The total number of validate campaign requests per second per client allowed is 10.  |
| Validate campaign per minute | The total number of validate campaign requests per minute per client allowed is 100. |
| Validate campaign per hour   | The total number of validate campaign requests per hour per client allowed is 6000.  |


## OpenAPI

````yaml /api/campaigns/campaign-draft.yaml post /v5/campaigns/{campaign_id}/validate
openapi: 3.0.3
info:
  title: MoEngage Campaigns API
  version: '2025-11-20'
  description: >
    The Campaigns V5 API manages the full campaign lifecycle - draft creation,
    incremental updates, validation, test sends, publication, and post-publish
    management.


    **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. **Publish** - Transition the draft to **ACTIVE** by sending `{ "status":
    "PUBLISH" }` in a PATCH request.

    6. **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).


    **Header change from V1 to V5:** The `MOE-APPKEY` request header is replaced
    by `X-MOE-Tenant-ID` in V5.

    - `X-MOE-Tenant-ID` is optional. When omitted, the workspace is resolved
    from the Basic Auth credentials in the `Authorization` header.

    - If you set the workspace via a header, use `X-MOE-Tenant-ID` in V5 in
    place of `MOE-APPKEY`.
  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: []
paths:
  /v5/campaigns/{campaign_id}/validate:
    post:
      tags:
        - Create Campaigns
      summary: Validate Campaign (V5)
      description: >
        Validates whether a draft would pass publish-time checks
        (`DRAFT_PUBLISH`) without making any changes to the draft.


        The request body is the same regardless of channel — all campaign data
        is read from the saved draft identified by `campaign_id` in the path, so
        there is no channel-specific payload.
      operationId: validate_draft_campaign_v5
      parameters:
        - $ref: '#/components/parameters/X-MOE-Tenant-ID'
        - $ref: '#/components/parameters/X-MOE-Request-Id'
        - name: campaign_id
          in: path
          required: true
          description: >
            Raw 24-char ObjectId of the campaign to validate. Use the `id` value
            returned in the Create Campaign response.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                request_id:
                  type: string
                  description: >-
                    Optional string (UUID v4 recommended) used to identify this
                    validation call. Unlike other POST endpoints, this field is
                    not required and does not enforce deduplication - the
                    validate endpoint is read-only and safe to retry freely.
                  example: '{{request_id}}'
            examples:
              validate:
                summary: Validate a draft campaign
                value:
                  request_id: '{{request_id}}'
      responses:
        '200':
          description: >-
            Validation result - always returned regardless of whether the
            campaign passes or fails validation.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/V5SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/V5ValidateResponse'
              examples:
                valid:
                  summary: Campaign passes validation
                  value:
                    response_id: abc-501
                    type: campaign
                    data:
                      valid: true
                invalid:
                  summary: Campaign fails validation
                  value:
                    response_id: abc-501
                    type: campaign
                    data:
                      valid: false
                      errors:
                        - field: >-
                            campaign_content.content.push.android.basic_details.title
                          issue: title is required
                        - field: scheduling_details
                          issue: scheduling_details is required for publish
        '400':
          $ref: '#/components/responses/V5ValidationError'
        '401':
          $ref: '#/components/responses/V5Unauthorized'
        '500':
          $ref: '#/components/responses/V5InternalError'
components:
  parameters:
    X-MOE-Tenant-ID:
      name: X-MOE-Tenant-ID
      in: header
      required: false
      description: >
        Workspace tenant ID. Set this to the workspace (App) ID from
        **Settings** > **Account** > **APIs** > **Workspace ID**.


        This header is optional. When omitted, the API resolves the workspace
        from the Basic Auth credentials in the `Authorization` header.


        In the V1 Campaigns API, the workspace ID was passed via the
        `MOE-APPKEY` request header. In V5, this header is renamed to
        `X-MOE-Tenant-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
  schemas:
    V5SuccessEnvelope:
      type: object
      properties:
        response_id:
          type: string
        type:
          type: string
          example: campaign
        data:
          type: object
    V5ValidateResponse:
      type: object
      description: >
        - When `valid` is `true`, only `valid` is returned.

        - When `valid` is `false`, `errors` lists one or more field-level issues
        found during publish-time validation (`DRAFT_PUBLISH`).
      properties:
        valid:
          type: boolean
          description: >-
            `true` if the campaign passes all publish-time validation checks.
            `false` if one or more checks fail.
          example: false
        errors:
          type: array
          description: >
            Present only when `valid` is `false`. Each item describes a single
            validation failure. Multiple errors can be returned, and more than
            one error can reference the same field.
          items:
            type: object
            properties:
              field:
                type: string
                description: >
                  Dot-separated JSON path to the field that failed validation,
                  relative to the campaign document root (for example,
                  `campaign_content.content.push.android.basic_details.title` or
                  `scheduling_details`).
                example: campaign_content.content.push.android.basic_details.title
              issue:
                type: string
                description: >-
                  Human-readable description of the validation failure for this
                  field. The value is free-form and may vary by channel,
                  delivery type, and component.
                example: title is required
    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.
  responses:
    V5ValidationError:
      description: Request failed schema or component validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V5ErrorEnvelope'
          example:
            response_id: abc-101
            error:
              code: VALIDATION_FAILED
              message: One or more fields failed validation.
              request_id: req-push-001
              details:
                - target: campaign_delivery_type
                  message: campaign_delivery_type value is required.
    V5Unauthorized:
      description: Authentication failure.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V5ErrorEnvelope'
          example:
            response_id: abc-101
            error:
              code: UNAUTHORIZED
              message: Invalid or missing credentials.
              details: []
    V5InternalError:
      description: Unhandled server-side failure.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V5ErrorEnvelope'
          example:
            response_id: abc-101
            error:
              code: INTERNAL_ERROR
              message: Internal server error.
              details: []
  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).

````