Skip to main content
POST
/
event
/
{Workspace_ID}
curl --request POST \
  --url https://api-0{dc}.moengage.com/v1/event/{Workspace_ID} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "event",
  "customer_id": "123",
  "actions": [
    {
      "action": "ProductAdded",
      "attributes": {
        "product": "Accessories",
        "color": "Black",
        "Brand": "Adidas"
      },
      "platform": "Android",
      "app_version": "1.2.3",
      "user_time": "1708939453396",
      "current_time": "1708939453396"
    }
  ]
}
'
{
"status": "success",
"message": "Your request has been accepted and will be processed soon."
}
  • If you have Portfolio enabled for your workspace, you need to pass project_code in the API endpoint. This identifies which project a user or event belongs to. For more information, refer to Portfolio: Data Ingestion and Management.
  • MoEngage does not accept any future dated events.

Rate Limit

A single API request contains one or more events. Maintain a rate limit of 30,000 events per minute.
MoEngage generates current_time and user_time if they are not provided in the request. Use the following information and provide current_time, user_time, and user_timezone_offset accordingly:
  • If you don’t provide any of current_time, user_time, and user_timezone_offset, MoEngage automatically uses the UTC time when the request was received by MoEngage as the current_time. MoEngage uses internal data to calculate the user_timezone_offset to generate the user_time.
  • If you provide only the current_time, MoEngage uses internal data to calculate the user_timezone_offset to generate the user_time.
  • If you provide only the user_time, MoEngage uses internal data to calculate the user_timezone_offset to generate the current_time.
  • If you send the current_time and user_time, MoEngage uses them as is.
  • If you provide the current_time and user_timezone_offset, MoEngage generates the user_time.
  • If you provide user_time and user_timezone_offset, MoEngage generates the current_time.

Example Payload

The example payload provides tracking of numeric, boolean, and date type event attributes. Use the payload described, where the price is numeric, departure_date is a date type attribute and premium_seat is a boolean attribute. To view the sample payload, select example_payload from the drop-down.

Array Support

If you want to pass an attribute in an array, the appropriate syntax for that is:
	"Array_attributeName":["abc","123"]
To view the sample cURL for adding and removing elements in an array, select array_support from the drop-down.

User Identity Resolution

If the User Identity Resolution feature is enabled in your workspace, identifiers set up in the workspace must be mentioned within the user_identifiers parameter. To view this sample payload where moe_mobile is one of the identifiers, select user_identity_resolution from the drop-down.
Following are the valid moe_os_type accepted in Moengage:
  • For RokuTV, it should be ROKU.
  • For LGTV, it should be WebOS.
  • For AndroidTV, it should be AndroidTV.
  • For AppleTV, it should be tvOS.
  • For SamsungTV, it should be Tizen.
  • For FireTV, it should be FireOS.
  • For VizioTV, it should be VizioTV.
  • For Xbox, it should be Xbox.

Authorizations

Authorization
string
header
required

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 Data tile.

Note: After you generate and save the Data API Key, DO NOT generate a new key unless there is a security breach. After you generate a different Data API key and save it, the authentication will start failing. You must update your existing data tracking.

For more information on authentication and getting your credentials, refer here.

Headers

X-Forwarded-For
string

The 'X-Forwarded-For' header is used to specify the IP address of the client that made the request. This header may be added by proxy servers or load balancers. The header value must contain the IP address of the original client that initiated the request. Multiple IP addresses may be specified in the header value, separated by commas.

Example:

"203.0.113.195"

Path Parameters

Workspace_ID
string
required

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

Example:

"OAPQQ2AMD01MJZYZX1YPG"

Body

application/json

Note: You cannot use “moe_” as a prefix while naming events, event attributes, or user attributes. It is a system prefix and using it might result in periodic blacklisting without prior communication.

type
enum<string>
required

This is used to identify the type of request. Allowed value is event. This field is case-sensitive. Follow the case as in the example when passing the value in the request.

Available options:
event
customer_id
string
required

Identifier to identify or create a user in MoEngage. Not mandatory in Identity resolution enabled workspaces.

actions
object[]
required

List of events to be tracked for the user.

device_id
string

Device_id in event payload is optional. The default value is the customer_id value. The value is used to map events to specific devices.

user_identifiers
object

Required if Identity Resolution is enabled and customer_id is not provided.

Example:
{ "moe_mobile": "+919876543210" }

Response

This response is returned when the request is processed successfully.

status
string

This field contains the status of the request and specifies whether the request was successful.

Example:

"success"

message
string
Example:

"Your request has been accepted and will be processed soon."