Skip to main content
PUT
/
v1.0
/
opt-in-management
/
user-preferences
Update User Email Opt-in Preferences
curl --request PUT \
  --url https://api-0{X}.moengage.com/v1.0/opt-in-management/user-preferences \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'MOE-APPKEY: <moe-appkey>' \
  --data '
{
  "user_preferences": {
    "customer_id": "ID_uid",
    "email_id": "john@example.com",
    "categories": {
      "category_1": true,
      "category_2": false
    },
    "opt_in_status": "DOUBLE_OPTED_IN",
    "channel": "email"
  }
}
'
{
"message": "Your request has been processed successfully"
}
This is an Early Access feature. To enable it for your account, contact your MoEngage Customer Success Manager (CSM) or the Support team.

Rate Limit

The rate limit is 1000 RPM (requests per minute) and 360K requests per day.
If you use PII Tokenization for your emails, ensure you pass the user ID when calling the Email Opt-in Management API. MoEngage uses this user ID to locate the user and update their opt-in status. Passing the email ID is ineffective in this case, as MoEngage does not store it.If you use PII Encryption to send emails, ensure you pass either the user ID or the decrypted email ID. MoEngage uses this information to locate the associated user and update their opt-in status, or to update the opt-in status of all users having that email ID.

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.

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

Headers

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

Body

application/json

The request body contains the user's email preference details encapsulated in a user_preferences object.

The main wrapper object for the user preferences payload.

user_preferences
object
required

Contains the user's opt-in preferences. Must contain either customer_id or email_id.

Response

The request has been processed successfully.

Success response body for the Opt-in Management API (200 OK).

message
string

The success message denoting the request was processed successfully.

Example:

"Your request has been processed successfully"