Skip to main content
POST
/
device
/
{app_id}
Track Device
curl --request POST \
  --url https://api-0{dc}.moengage.com/v1/device/{app_id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "device",
  "customer_id": "<string>",
  "device_id": "<string>",
  "attributes": {
    "platform": "ANDROID",
    "push_id": "<string>",
    "model": "<string>",
    "moe_push_opted": "True",
    "moe_push_provisional_opted": "<string>",
    "app_version": "<string>",
    "os_version": "<string>",
    "moe_gaid": "<string>",
    "idfv": "<string>"
  }
}
'
{ "status": "success", "message": "Your request has been accepted and will be processed soon." }

Use Cases

  • Create a new device for an existing user
  • Create new device properties for an existing user
  • Update the device properties of the existing user

Rate Limit

You can track 10,000 devices per minute.

Postman Collections

We have made it easy for you to test the APIs. Click here to view it in Postman.

FAQs

  • How to identify the events to a given user? What identifiers can I use?
Events in the payload need to be mapped to a given user who has executed the event. You must use the Customer ID to identify the events mapped to a customer.
  • Can I send events for anonymous users?
No, anonymous users can be tracked using MoEngage SDKs.
  • Can events be updated/modified?
Events in MoEngage are immutable, i.e., events can only be created, they cannot be updated or deleted.

Authorizations

Authorization
string
header
required

This authentication parameter, used for access control, must be passed along with the request. The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username:password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:

{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}

The username and password details can be obtained from the MoEngage Dashboard. If you're using the API for the first time, follow these steps:

  1. Navigate to Settings -> Account -> APIs.
  2. Copy the following details:
    • Username: Under Workspace ID (earlier app id), click the copy icon to copy the username.
    • Password: In the API keys section, click the copy icon in the Data tile to copy the API key.

Use these details to authenticate the API requests.

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

app_id
string
required

This is the Workspace ID of your MoEngage account that must be included in the request. You can find your Workspace ID in the following navigation on the dashboard: Settings > Account > APIs > Workspace ID.

Example:

"VJ0GSMESHMQA3L7WV1EEK3UR"

Body

application/json
type
enum<string>
required

This field denotes the type of request. Supported value is: device. This field is case-sensitive. When passing the value in the request, follow the case as in the example.

Available options:
device
customer_id
string
required

This field denotes the unique identifier used to identify a user in MoEngage. Note that devices can be created for existing users only.

device_id
string
required

This field denotes the unique identifier used to identify the device associated with a user in MoEngage. If your app is integrated with MoEngage SDK, the SDK assigns a unique device_id to the devices of your end-users. If your app is not integrated with MoEngage SDK, you can use unique alphanumeric values or other device attributes such as Push token, GAID/IDFV to assign unique device_id values to devices of your user.

attributes
object
required

This field contains the device attributes to add or update in the device profile.

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