openapi: 3.0.3 info: title: MoEngage Push API version: '2.0' description: | # Overview Push API is used to: * Create campaigns (targeting all users or a group of users) to send notifications. * Target a single user using a unique user attribute. * Personalize payload for each user. tags: - name: Transactional description: Operations to create and send push notification campaigns. servers: - url: 'https://pushapi-{dc}.moengage.com/v2' description: MoEngage Push API Server variables: dc: default: '01' description: "The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number and replace the value of ‘dc’ in the URL by referring to the DC and API endpoint mapping [here](/api/introduction#data-centers). Your MoEngage Data Center (DC) can be 01, 02, 03, 04, 05, 06, or 101." paths: /transaction/sendpush: post: tags: - Transactional summary: Send Push Notification description: | This API creates and sends a push notification campaign. You can use this API to create campaigns (targeting all users or a group of users) to send notifications, target a single user using a unique user attribute, and personalize payload for each user. #### Rate Limit The rate limit is 10,000 requests per minute. #### Migrating to v2.1 This version does not use a separate query-type header — MoEngage resolves the request category directly from the `targetAudience` field in the request body. The [v2.1 endpoint](/api/push/push-api) introduces the `X-MOE-Query-Type` header as an explicit equivalent, sent alongside `targetAudience` rather than in place of it. No action is required if you continue using this version. x-mint: content: | #### Authentication A signature is required to verify whether the client is authorized to make the API call. It is generated from a hash of the campaign name, app ID, and API key. MoEngage uses the SHA 256 method to generate this hash. Python code is used to generate the signature for your test account, and use your account's app_id. 1. On the left navigation menu in the MoEngage dashboard, go to **Settings** > **Account** > **APIs**. 2. Copy the following details: * **app_id**: Under **Workspace ID (earlier app_id)**, click the copy icon to copy the app-id. * **api_key**: In the **API keys** section, click the copy icon in the **Push** tile to copy the API key. * **campaign_name**: Ensure the campaign name matches the one used in the request body. ### Generating Signature Python code to generate the signature for your test account, use the app_id that is appropriate for your account. ```python from hashlib import sha256 app_id = "{{Your Workspace ID}}" campaign_name = "{{your campaign name}}" api_key = "{{your push api key}}" signature_key = app_id+'|'+ campaign_name+'|'+ api_key signature = sha256(signature_key.encode('utf-8')).hexdigest() print(signature) ``` ```python from hashlib import sha256 app_id = "{{Your Workspace ID}}" campaign_name = "{{your campaign name}}" api_key = "{{your push api key}}" signature_key = app_id+'|'+ campaign_name+'|'+ api_key signature = sha256(signature_key).hexdigest() print(signature) ``` requestBody: required: true description: "The complete configuration for the push campaign." content: application/json: schema: $ref: '#/components/schemas/PushRequest' examples: Base Sample Request: summary: 1. Base Sample Request value: appId: "{{your Workspace ID}}" campaignName: "{{your campaign name}}" signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID"] targetAudience: "User" targetUserAttributes: attribute: "USER_ATTRIBUTE_USER_EMAIL" comparisonParameter: "is" attributeValue: "abc@example.com" payload: ANDROID: message: "message" title: "title" campaignDelivery: type: "soon" Android App: summary: 2. Ex 1 - Android App value: appId: "{{appId}}" campaignName: "{{campaignName}}" signature: "{{signature}}" targetPlatform: ["ANDROID"] targetAudience: "User" targetUserAttributes: attribute: "USER_ATTRIBUTE_UNIQUE_ID" comparisonParameter: "is" attributeValue: "123" campaignDelivery: type: "soon" payload: ANDROID: message: "Message" title: "Title" channel_id: "ChannelId" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" kvPairs: key1: "value1" Key2: "value2" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" fallback: {} iOS App: summary: 3. Ex 1 - iOS App value: appId: "{{appId}}" campaignName: "{{campaignName}}" signature: "{{signature}}" targetPlatform: ["IOS"] targetAudience: "User" targetUserAttributes: attribute: "USER_ATTRIBUTE_UNIQUE_ID" comparisonParameter: "is" attributeValue: "123" campaignDelivery: type: "soon" payload: IOS: message: "Message" title: "Tittle" subtitle: "Subtitle" enableIosBadge: true richContent: - type: "sound" value: "custSound4.wav" - type: "coupon" value: "free" - type: "image" value: "product_image.jpg" additionalActions: - category: "INVITE_CATEGORY" defaultAction: type: "navigation" value: "" kvPairs: key1: "value1" Key2: "value2" fallback: message: "fallback ios" title: "title" richContent: - type: "coupon" value: "iOS" additionalActions: - category: "INVITE_CATEGORY" Web Chrome: summary: 4. Ex 1 - Web (Chrome) value: appId: "{{appId}}" campaignName: "{{campaignName}}" signature: "{{signature}}" targetPlatform: ["WEB"] targetAudience: "User" targetUserAttributes: attribute: "USER_ATTRIBUTE_UNIQUE_ID" comparisonParameter: "is" attributeValue: "123" campaignDelivery: type: "soon" payload: WEB: message: "Message" title: "Title" redirectURL: "https://www.google.com" iconURL: "https://app.moengage.com/v3/images/favicon.ico" imageURL: "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg" Target All Android: summary: 5. Ex 2 - Target All (Android) value: appId: "{{your Workspace ID}}" campaignName: "Test Push" campaignTags: ["Transactional"] signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID"] targetAudience: "All Users" payload: ANDROID: message: "Android Message" title: "Android Message Title" summary: "Android Summary" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: ANDROID: 12 ignoreFC: "false" sendAtHighPriority: "true" inboxExpiry: 360 Target All iOS: summary: 6. Ex 2 - Target All (iOS) value: appId: "{{your Workspace ID}}" campaignName: "Test Push" campaignTags: ["Promotional"] signature: "{{Signature}}" requestType: "push" targetPlatform: ["IOS"] targetAudience: "All Users" payload: IOS: message: "iOS Message" title: "iOS Message Title" richContent: - type: "sound" value: "custSound4.wav" additionalActions: - category: "INVITE_CATEGORY" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ignoreFC: "false" inboxExpiry: 360 Target All Web: summary: 7. Ex 2 - Target All (Web) value: appId: "{{your Workspace ID}}" campaignName: "Test Push" signature: "{{Signature}}" requestType: "push" targetPlatform: ["WEB"] targetAudience: "All Users" payload: WEB: message: "Web Message" title: "Web Message Title" redirectURL: "https://www.google.com" iconURL: "https://app.moengage.com/v3/images/favicon.ico" imageURL: "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: WEB: 24 ignoreFC: "false" sendAtHighPriority: "true" All Platforms: summary: 8. Ex 2 - All Platforms value: appId: "{{your Workspace ID}}" campaignName: "Test Push" signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID", "IOS", "WEB"] targetAudience: "All Users" payload: ANDROID: message: "Android Message" title: "Android Message Title" Summary: "summary" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" IOS: message: "iOS Message" title: "iOS Message Tittle" richContent: - type: "sound" value: "custSound4.wav" additionalActions: - category: "INVITE_CATEGORY" WEB: message: "Web Message" title: "Web Message Title" redirectURL: "https://www.google.com" iconURL: "https://app.moengage.com/v3/images/favicon.ico" imageURL: "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: ANDROID: 12 WEB: 24 ignoreFC: "false" sendAtHighPriority: "true" inboxExpiry: 360 Target Single User: summary: 9. Ex 3 - Target Single User value: appId: "{{your Workspace ID}}" campaignName: "Test Push" signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID"] targetAudience: "User" targetUserAttributes: attribute: "USER_ATTRIBUTE_USER_EMAIL" comparisonParameter: "is" attributeValue: "abc@example.com" payload: ANDROID: message: "Android Message" title: "Android Message Title" summary: "Android Summary" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: ANDROID: 12 ignoreFC: "false" sendAtHighPriority: "true" inboxExpiry: 360 Custom Segment: summary: 10. Ex 3 - Custom Segment value: appId: "{{your Workspace ID}}" campaignName: "Test Push" signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID", "IOS", "WEB"] targetAudience: "Custom Segment" customSegmentName: "Android_TranV2" payload: ANDROID: message: "testing txn v2" title: "testing txn v2" Summary: "summary" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" IOS: message: "7th" title: "Test Case custom segment5" richContent: - type: "sound" value: "custSound4.wav" additionalActions: - category: "INVITE_CATEGORY" WEB: message: "Test Case WEB" title: "Test Case WEB" redirectURL: "https://www.google.com" iconURL: "https://app.moengage.com/v3/images/favicon.ico" imageURL: "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: ANDROID: 12 WEB: 24 ignoreFC: "false" sendAtHighPriority: "true" inboxExpiry: 360 Custom Attribute: summary: 11. Ex 3 - Custom Attribute value: appId: "{{your Workspace ID}}" campaignName: "Test Push" signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID"] targetAudience: "User" targetUserAttributes: attribute: "user" comparisonParameter: "is" attributeValue: "user" isCustom: true payload: ANDROID: message: "Android Message" title: "Android Message Title" summary: "Android Summary" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: ANDROID: 12 ignoreFC: "false" sendAtHighPriority: "true" inboxExpiry: 360 All Users Detailed: summary: 12. Ex 3 - All Users (Detailed) value: appId: "{{your Workspace ID}}" campaignName: "Test Push" signature: "{{Signature}}" requestType: "push" targetPlatform: ["ANDROID", "IOS", "WEB"] targetAudience: "All Users" payload: ANDROID: message: "gp 7th nov" title: "7th nov" richContent: - type: "image" value: "https://images.iimg.in/c" - type: "coupon" value: "free" - type: "sound" value: "notification_tone.wav" defaultAction: type: "richlanding" value: "https://www.google.co.in/webhp" additionalActions: - type: "call" value: "{{phone_number}}" name: "Call button" iconURL: "{{call_icon_url}}" - type: "copy" value: "{{phone_number}}" name: "Copy button" iconURL: "{{copy_icon_url}}" IOS: message: "7th" title: "Test Case custom segment5" richContent: - type: "sound" value: "custSound4.wav" additionalActions: - category: "INVITE_CATEGORY" WEB: message: "Test Case WEB" title: "Test Case WEB" redirectURL: "https://www.google.com" iconURL: "https://app.moengage.com/v3/images/favicon.ico" imageURL: "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg" campaignDelivery: type: "soon" conversionGoals: - name: "amount 1" eventName: "AddedTocart" attrs: filter: "is between" name: "amount" value: "10,100" type: "numeric" advancedSettings: ttl: ANDROID: 12 WEB: 24 ignoreFC: "false" sendAtHighPriority: "true" inboxExpiry: 360 responses: '200': description: | Request received. The status in the response body indicates whether it was successfully processed or failed. Possible failures include: * Invalid Request Type * Invalid appId / appId not present * Campaign Name too short (must be >= 5 chars) / Campaign name missing * Request limit exceeded * Signature missing or not verified * Duplicate campaign name * Key not of Type List or Value not allowed * Error parsing parameters **Response fields:** * `status`: `Success` or `Fail`, indicating whether the campaign was accepted. * `requestId`: The request ID you sent, echoed back (empty on failure). * `responseId`: A unique ID MoEngage generates for this response. * `cid`: The campaign ID (present on success only). * `Error_Message`: A human-readable failure reason (present on failure only). This response envelope (`status`, `requestId`, `responseId`, `cid`) predates MoEngage's newer API conventions (for example, the `{response_id, type, data}` shape used by the Analytics Custom Dashboards API) and is kept as-is here for backward compatibility. content: application/json: schema: oneOf: - $ref: '#/components/schemas/PushSuccessResponse' - $ref: '#/components/schemas/PushFailureResponse' examples: Success: summary: Success Response value: status: Success requestId: "09562729-236b-4773-8207-63321523456" responseId: "09562729-236b-4773-8207-63321523456" cid: "66321523456" Failure: summary: Failure Response (200 OK) value: status: Fail Error_Message: Campaign Name not found responseId: "09562729-236b-4773-8207-63321523456" requestId: "" '401': description: Unauthorized. Invalid authentication credentials or JSON format. content: application/json: example: [] '404': description: Not Found. Invalid endpoint. content: application/json: schema: $ref: '#/components/schemas/NotFoundResponse' example: code: 404 status: error reason: "Page not found. Please recheck the URL" '500': description: Internal Server Error. content: application/json: example: code: 500 status: error reason: "There seems to be an error. We are working to fix this." reference: "reference" 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**: Use your API Key, which you can find within the **Push** tile. For more information on authentication and getting your credentials, refer [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials). apiKeyAuth: type: apiKey in: header name: MOE-APPKEY description: This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at **Settings** > **Account** > **APIs** > **Workspace ID (earlier app id)**. schemas: TargetUserAttributes: type: object properties: attribute: type: string description: | This field denotes a unique identifier or characteristic of an entity or object used to specify the target users. This value is required when the targetAudience value is User. Other fields used are: * for unique ID: USER_ATTRIBUTE_UNIQUE_ID * for email: USER_ATTRIBUTE_USER_EMAIL * For mobile number: USER_ATTRIBUTE_USER_MOBILE * for Google Advertising identifier: MOE_GAID * for iOS Identifier for advertising: ADVERTISING_IDENTIFIER * for device push token: PUSH_ID (the same key is used for Android GCM ID, iOS push token) For more information, refer to [Target User Attributes](/hc/en-us/articles/32986034181268#h_01JGZQ07FC9P3RHKXYJ67AJ9QV). enum: [USER_ATTRIBUTE_UNIQUE_ID, USER_ATTRIBUTE_USER_EMAIL, USER_ATTRIBUTE_USER_MOBILE, MOE_GAID, ADVERTISING_IDENTIFIER, PUSH_ID] comparisonParameter: type: string description: | This field denotes a condition or operator that compares the user attributes against a specific value. Supported values are: * The "is" query type * The "in" query type * Note: The maximum number of parameters that can be added while using the "in" comparisonParameter is 50. This value is required when the targetAudience value is User. enum: [is, in] attributeValue: oneOf: - type: string - type: array items: type: string description: "This field denotes the actual value assigned to an attribute, which is used for comparison or filtering. This value is required when the targetAudience value is User." isCustom: type: boolean description: "This field denotes whether a custom attribute has been added. For custom attributes, targeting is done on any custom attribute with the available fields. Set the key \"isCustom\" to true." default: false DefaultAction: type: object properties: type: type: string enum: [richlanding, navigation, deeplinking] value: type: string description: The URL or deep link path. kvPairs: type: object additionalProperties: type: string description: Additional key-value pairs to pass with the action. AndroidPayload: type: object required: [message, title] properties: groupKey: type: string description: | This field denotes the group key used to identify and categorize related push notifications. Note: * Ensure you use the same group key for all push notifications you want to group. * MoEngage automatically modifies the group key to ensure it does not exceed the 45-character limit. MoEngage removes non-Latin scripts, special characters, and spaces to restrict the key composition to ASCII characters exclusively. collapseReplaceKey: type: string description: "This field denotes the update key used to identify and update related push notifications. Ensure you use the same update key for all push notifications intended to update each other." message: type: string description: "This field denotes the main content or text to be displayed in the notification/message." title: type: string description: "This field denotes the headline or subject of the notification/message." channel_id: type: string description: "This field denotes the channel identifier for the campaign." summary: type: string description: "This field denotes the brief summary or condensed version of the content. Typically displayed in collapsed notifications." richContent: type: array items: type: object properties: type: { type: string, enum: [image, coupon, sound] } value: { type: string } description: | An object or HTML string containing rich text, images, or other multimedia to enhance the message. Supported values are: * Coupon * Image * Sound defaultAction: $ref: '#/components/schemas/DefaultAction' description: "This helps you define the default action triggered when the user interacts with the notification." additionalActions: type: array maxItems: 2 items: type: object properties: type: { type: string, enum: [call, snooze, copy, share] } value: { type: string } name: { type: string } iconURL: { type: string } description: | This object contains a list of extra actions or buttons that the user can perform, providing more functionality for the notification. Supported actions are: * Call * Snooze * Copy * Share A maximum of two additional action buttons can be used at a time. fallback: type: object description: "This JSON object contains the fallback values for the values mentioned above." IOSPayload: type: object required: [message, title] properties: groupKey: type: string description: | This field denotes the group key used to identify and categorize related push notifications. Note: * Ensure you use the same group key for all push notifications you want to group. * MoEngage automatically modifies the group key to ensure it does not exceed the 45-character limit. MoEngage removes non-Latin scripts, special characters, and spaces to restrict the key composition to ASCII characters exclusively. collapseReplaceKey: type: string description: "This field denotes the update key used to identify and update related push notifications. Ensure you use the same update key for all push notifications intended to update each other." message: type: string description: "This field denotes the primary text or body of the notification/message." title: type: string description: "This field denotes the title or subject line of the notification/message." subtitle: type: string description: "This field denotes the subtitle of the notification/message." enableIosBadge: type: boolean description: "This field specifies whether a notification should automatically update the iOS app’s badge count with push notifications. Supported values are 'true' and 'false'." richContent: type: array items: type: object properties: type: { type: string, enum: [gif, coupon, sound, image, audio, video] } value: { type: string } description: | This field denotes a resource, such as an image or multimedia attachment, to provide additional visual or interactive elements. Supported contents are: * GIF * Coupon * Sound * Image * Audio * Video Image, video, and audio are only supported after iOS-10. To use emoticons (emojis), just copy-paste it where required (for example, ❤️ ) Note: Image, video, and audio can not be used together. defaultAction: $ref: '#/components/schemas/DefaultAction' description: | This object contains a set of default actions associated with the notifications. Supported values are: * Navigation * Richlanding * Deeplinking additionalActions: type: array items: type: object properties: category: { type: string } description: "This object contains a set of supplementary actions or buttons associated with the notification, enabling users to perform specific tasks. You can add only one category for additional actions." fallback: type: object description: "This JSON object contains the fallback values for the values mentioned above." WebPayload: type: object required: [message, title, redirectURL, iconURL] properties: message: type: string description: "This field denotes the main text content or notification body displayed to users." title: type: string description: "This field denotes the subject or heading of the notification." redirectURL: type: string format: uri description: "This field denotes the URL to which the user will be redirected upon interacting with the notification." iconURL: type: string format: uri description: "This field denotes the URL of an icon image representing the notification, usually displayed alongside the title and message." imageURL: type: string format: uri description: "This field denotes the URL of an additional image to be shown in the notification, providing further context or visual appeal." autoDismiss: type: boolean description: "This field specifies whether to dismiss the notification automatically after 8 seconds." Payload: type: object description: | This object contains the payload details. Supported values are: * Android. For more information, refer to [Android](/hc/en-us/articles/32986034181268#h_01JGZQJ15BBPB56MCAPZTNKASC). * iOS. For more information, refer to [IOS](/hc/en-us/articles/32986034181268#01JGZQRNMF624JYWRH4T882JPR). * Web. For more information, refer to [Web](/hc/en-us/articles/32986034181268#01JGZQRQTMXFC01DWTJZJAT2TQ). properties: ANDROID: $ref: '#/components/schemas/AndroidPayload' IOS: $ref: '#/components/schemas/IOSPayload' WEB: $ref: '#/components/schemas/WebPayload' CampaignDelivery: type: object required: [type] properties: type: type: string enum: [soon, later, periodic] date: type: string description: "Required for 'later' type. Format: MM/DD/YYYY" time: type: string description: "Required for 'later' and 'periodic' types. Format: HH:MM AM/PM" endDate: type: string description: "Required for 'periodic' type. Format: MM/DD/YYYY" repeatAfter: type: string description: "Repeat interval in days for 'periodic' type." timezone: type: string description: "Timezone for scheduling, e.g., 'Asia/Kolkata'. Defaults to IST if not provided. For more information on allowed timezone values, refer [here](https://gist.github.com/mjrulesamrat/0c1f7de951d3c508fb3a20b4b0b33a98)." ConversionGoal: type: object required: [name, eventName] properties: name: { type: string, description: "This field denotes the readable name of the conversion goal for the Campaign Info." } eventName: { type: string, description: "This field denotes the actual event name." } attrs: type: object description: | This object contains the conversion goals details. This field denotes the event attribute filters. It contains the following elements: * name: Event attribute name. This is mandatory. * filter: Event attribute filter operator. This is mandatory. * value: Event attribute filter value. * type: Event attribute data type. This is mandatory. properties: name: { type: string } filter: type: string enum: - is - is not - contains - does not contain - starts with - does not start with - ends with - does not end with - in the following - not in the following - exists - does not exist - is equal to - is not equal to - is between - is not between - is less than - is greater than value: oneOf: [{ type: string }, { type: number }, { type: array, items: { type: string } }] type: { type: string, enum: [string, numeric] } AdvancedSettings: type: object description: "This object contains information about advanced settings. For more information, refer to [Advanced Settings](/hc/en-us/articles/32986034181268#h_01JGZRM6BSGJ9VS3YWKB21DYFW)." properties: ttl: type: object description: "This field denotes the duration for which the push notification service keeps a push message before it's discarded if it can't be delivered. If not delivered, Push Services (GCM/WEB) retry to send the message until the TTL (in minutes) does not expire. Send ‘0’ if it is not applicable to you. After the TTL has expired, push notifications will not be shown to the user. The default value for TTL is 36 hours and applies only to Android push or Web push notifications." properties: ANDROID: { type: integer, description: "TTL in minutes for Android." } WEB: { type: integer, description: "TTL in minutes for Web." } ignoreFC: oneOf: - type: string enum: ["true", "false"] - type: boolean description: | This field denotes if the ignoreFC is enabled. Supported values are: * true * false Note: This field is case-sensitive. When passing the value in the request, follow the case as described in the allowed values above. * "true" value: Bypasses frequency capping set on the dashboard and sends the notifications to everyone in the target segment. * "false" value: Applies the frequency capping set on the dashboard and does not send the notification after the limit is reached. * If the key is not present, it will be treated as ignoreFC="false." While testing your API, ensure that you set this flag as "true"; otherwise, you might not receive a few notifications. countFC: oneOf: - type: string enum: ["true", "false"] - type: boolean description: | This field denotes if the countFC is enabled. Supported values are: * true * false Values are "true" or "false" only when ignoreFC value is set to true. * "true" value - Only Push campaigns are counted in the frequency cap count. * "false" value - Push campaigns are not counted in the frequency cap count. notificationPrioritySettings: type: object description: "This field denotes whether the notification priority settings are configured. Supported values are \"true\" or \"false\" only for Android push / Web push notifications. It uses the GCM/FCM flag to send time-critical messages with high priority and drains the user's device battery more than normal messages. This object contains information about notification priority settings. For more information, refer to [notificationPrioritySettings](/hc/en-us/articles/32986034181268#h_01JJ3VXZZQ1Z4N9VVNGWGE6B9J)." properties: Android: type: string enum: [High, Low] description: | This field denotes the notification priority configured for Android devices for this campaign. Supported values are: * High * Low iOS: type: integer enum: [1, 5, 10] description: | This field denotes the notification priority configured for iOS devices for this campaign. Supported values are: * 1 * 5 * 10 "pushAmp+": oneOf: - type: string enum: ["true", "false"] - type: boolean description: "This field denotes whether the pushAmp+ is enabled. Supported values are \"true\" or \"false.\" For more information about Push Amp+, refer to [Push Amp+ help documentation](/user-guide/campaigns-and-channels/mobile-push/analyze/push-amplification-plus-and-delivery-impact)." preCacheSegment: oneOf: - type: string enum: ["true", "false"] - type: boolean description: "This field denotes whether the preCacheSegment is enabled. Supported values are \"true\" or \"false.\" Applicable for scheduled and periodic campaigns. If enabled, pre-caches the segmentation and improves campaign sending time. For caching, it is recommended that the campaign be created at least 2 hours before the scheduled time." campaignThrottleTime: type: integer description: "This field denotes if the campaign throttle time is configured. Push throttling allows you to control the rate of sending a push notification. The value to be passed can be between 1 and 360 (minutes)." campaignThrottleRpm: type: integer description: | The default throughput for the Push API is 100K RPM. You can send either of the key-value pairs in the Push API payload between campaignThrottleRpm and campaignThrottleTime. Both of the key-value pairs are optional. * If you send both, the value for campaignThrottleRpm takes precedence over the value for campaignThrottleTime. * If you send either of them, the value you send is considered. * If you do not send any of them, the value defined in settings is considered. * If the RPM value is not defined in settings, the default RPM for Push channel (that is, 100K) is enforced. For personalized campaigns, the maximum RPM value MoEngage supports is 250K. useJinjaPersonalization: oneOf: - type: string enum: ["true", "false"] - type: boolean description: "This field denotes whether Jinja personalization can be used in the payload. Values are \"true\" or \"false.\" A boolean value is used to indicate if Jinja personalization is applied to the message payloads. It is recommended that this personalization format be used." ignoreMinimumDelay: oneOf: - type: string enum: ["true", "false"] - type: boolean default: true description: "This field denotes whether ignore minimum delay is enabled. Supported values are \"true\" or \"false.\" This is a boolean value to indicate if the Client level Minimum Delay setting should be applied for the campaign. The default value is true, if this field is not passed in the API." inboxExpiry: type: integer description: "This field specifies the expiry value for the push notification in hours." iOSTargetDevice: type: string enum: [apns_device_default_push, apns_device_provisional_push, apns_device_non_provisional_push] description: | Supported values are: * apns_device_default_push * apns_device_provisional_push * apns_device_non_provisional_push deliverWhenActive: oneOf: - type: string enum: ["true", "false"] - type: boolean description: "This field specifies whether the push notifications will be delivered when the device is in an active state. supported value: \"true\" and \"false\"." bypassDND: type: boolean description: "This field specifies whether to deliver the notification immediately, bypassing device restrictions such as battery optimizations or low-power modes." sendAtHighPriority: oneOf: - type: string enum: ["true", "false"] - type: boolean description: "Send at high priority (legacy flag)." PushRequest: type: object required: - appId - campaignName - signature - targetPlatform - targetAudience - payload - campaignDelivery properties: appId: type: string description: "This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at **Settings** > **Account** > **APIs** > **Workspace ID (earlier app id)**. MoEngage recommends that you test API integration in the Test Environment. The App ID for TEST ACCOUNT is suffixed with _DEBUG. In the [v2.1 endpoint](/api/push/push-api), this same value is sent as the `X-MOE-APPKEY` request header instead of a request body field." campaignName: type: string minLength: 5 description: | This field denotes the campaign name. The campaign name should be unique for All Users and Custom Segment campaigns. Note: * API automatically creates a campaign with the given name. You need not create a campaign from the dashboard to use the name. * For User type targetAudience API requests, reuse this campaign name for requests that should be clubbed in the same campaign. campaignTags: type: array items: { type: string } description: | Used to add more context to campaigns. Context can be descriptive names or campaign themes such as onboarding, retention, country, and all users. Tags can also be used to filter campaigns or identify the behaviors of users who received these campaigns. The list of tags should be passed in this field. For example, ```json “campaignTags“ : [“Transactional“, “Accounts“] ``` signature: type: string description: "This field denotes the signature that is required to verify whether the client is authorized to make the API call. For more information, refer to Generate Authentication Signature." requestType: type: string default: "push" description: "The value of this key is used to indicate the intention of an API request. The default value is push." targetPlatform: type: array items: type: string enum: [ANDROID, IOS, WEB] description: "This field denotes the platform devices that are targeted by your campaign. The Push API allows you to target users on Android, iOS, and Web platforms. You can target one or more platforms. If you want to send Web (Chrome) push notifications through the API, you should choose Web as the platform." targetAudience: type: string enum: ["All Users", "Custom Segment", "User"] description: | This field denotes the target segment for the campaign. Supported values are: * All Users: Pass this value to target all users of your App/Website. * Custom Segment: Pass this value to target pre-created user segments. Custom segments can be created using the MoEngage dashboard or [custom segment API](/api/filter-segments/create-filter-segment). Note that the custom segment name should exactly match the name of the target segment. * User: Pass this value to target a user with an attribute. It will target a maximum of 100 users of the associated targetUserAttributes definition. customSegmentName: type: string description: "Required if targetAudience is 'Custom Segment'." targetUserAttributes: $ref: '#/components/schemas/TargetUserAttributes' description: | This object contains the target user attribute details. Note: * This value is required when the targetAudience value is User. * For API requests where the target audience is a specific user, if a campaign with the given name already exists, existing campaign data corresponding to the given name will be used to send notifications. * Any edits in other parts of campaign data except payload within the API request parameters will be ignored. * If any changes are required in the campaign data, change the campaign name in the API request to create a new campaign. payload: $ref: '#/components/schemas/Payload' description: | This object contains the payload details. Supported values are: * Android. For more information, refer to [Android](/hc/en-us/articles/32986034181268#h_01JGZQJ15BBPB56MCAPZTNKASC). * iOS. For more information, refer to [IOS](/hc/en-us/articles/32986034181268#01JGZQRNMF624JYWRH4T882JPR). * Web. For more information, refer to [Web](/hc/en-us/articles/32986034181268#01JGZQRQTMXFC01DWTJZJAT2TQ). campaignDelivery: $ref: '#/components/schemas/CampaignDelivery' description: | This field helps decide when the campaign should be sent. **ASAP** ```json // send campaign asap "campaignDelivery": { "type": "soon" } ``` **Schedule Later** ```json "campaignDelivery": { "type": "later", "date": "11/07/2016", "time": "04:33 PM" } ``` **Recurring Campaigns** ```json "campaignDelivery": { "type": "periodic", "endDate": "11/07/2016", "time": "04:55 PM", "timezone": "Asia/Calcutta", "repeatAfter": "1" // campaign will be recurring sent after every 1 day. } ``` conversionGoals: type: array maxItems: 5 items: $ref: '#/components/schemas/ConversionGoal' description: | This object contains the conversion goals details. This field denotes the event attribute filters. It contains the following elements: * name: Event attribute name. This is mandatory. * filter: Event attribute filter operator. This is mandatory. * value: Event attribute filter value. * type: Event attribute data type. This is mandatory. **Single Conversion Goal** ```json "conversionGoals": [ { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "is", "value": "10089712", "type": "string" } } ] ``` **Multiple Conversion Goals** ```json "conversionGoals": [ { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "is", "value": "10089712", "type": "string" } }, { "name": "Order Placed", "eventName": "OrderSuccess", "attrs": { "name": "product_price", "filter": "is equal to", "value": 999, "type": "numeric" } } ] ``` **Without Event Attribute Filter** ```json { "name": "Added To Cart", "eventName": "AddedTocart" } ``` **With String Event Attribute Filter** With "is" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "is", "value": "10089712", "type": "string" } } ``` With "is not" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "is not", "value": "10089712", "type": "string" } } ``` With "contains" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "contains", "value": "10089712", "type": "string" } } ``` With "does not contain" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "does not contain", "value": "10089712", "type": "string" } } ``` With "starts with" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "starts with", "value": "10089712", "type": "string" } } ``` With "does not start with" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "does not start with", "value": "10089712", "type": "string" } } ``` With "ends with" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "ends with", "value": "10089712", "type": "string" } } ``` With "does not end with" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "does not end with", "value": "10089712", "type": "string" } } ``` With "in the following" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "in the following", "value": ["10089711", "10089712", "10089713"], "type": "string" } } ``` With "not in the following" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "not in the following", "value": ["10089711", "10089712", "10089713"], "type": "string" } } ``` With "exists" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "exists", "type": "string" } } ``` With "does not exist" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_sku", "filter": "does not exist", "type": "string" } } ``` **With Numeric/Double Event Attribute Filter** With "is equal to" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "is equal to", "value": 999, "type": "numeric" } } ``` With "is not equal to" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "is not equal to", "value": 999, "type": "numeric" } } ``` With "is between" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "is between", "value": "899,999", "type": "numeric" } } ``` With "is not between" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "is not between", "value": "899,999", "type": "numeric" } } ``` With "is greater than" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "is greater than", "value": 999, "type": "numeric" } } ``` With "is less than" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "is less than", "value": 999, "type": "numeric" } } ``` With "exists" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "exists", "type": "numeric" } } ``` With "does not exist" operator: ```json { "name": "Added To Cart", "eventName": "AddedTocart", "attrs": { "name": "product_price", "filter": "does not exist", "type": "numeric" } } ``` advancedSettings: $ref: '#/components/schemas/AdvancedSettings' description: "This object contains information about advanced settings. For more information, refer to [Advanced Settings](/hc/en-us/articles/32986034181268#h_01JGZRM6BSGJ9VS3YWKB21DYFW)." PushSuccessResponse: type: object title: Success Response properties: status: type: string enum: [Success] description: "This field indicates the campaign status." requestId: type: string description: "This field indicates the request ID." responseId: type: string description: "This field indicates the response ID." cid: type: string description: "This field indicates the campaign ID." PushFailureResponse: type: object title: Failure Response properties: status: type: string enum: [Fail] description: "This field indicates the campaign status." Error_Message: type: string description: "This field indicates why the request failed." example: "Campaign Name not found" responseId: type: string description: "This field indicates the response ID." requestId: type: string description: "This field indicates the request ID." NotFoundResponse: type: object title: Not Found Response properties: code: type: integer description: "This field indicates the HTTP status code of the response." example: 404 status: type: string description: "This field indicates the outcome category of the request." example: "error" reason: type: string description: "This field indicates why the request was not found. For this endpoint, it means the request path does not match a valid MoEngage API endpoint." example: "Page not found. Please recheck the URL"