Skip to main content
PUT
/
category-subscription
/
user-preferences
Update Subscription Preferences
curl --request PUT \
  --url https://api-{dc}.moengage.com/v1/category-subscription/user-preferences \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: <content-type>' \
  --header 'MOE-APPKEY: <moe-appkey>' \
  --data '
{
  "unsubscribe_all": true,
  "categories": {
    "Promotional": true,
    "Transactional": false,
    "Special Offers": true,
    "Product Updates": true,
    "New arrivals": false,
    "Recommendations": true,
    "Newsletter": true
  }
}
'
{ "message": "Success" }

Rate Limit

The rate limit is 100 RPM and 360k per day.

FAQs

How do we fetch the parameters to be passed in the request? The user_id (MoEngage ID) and the cid (Campaign ID) fields should be fetched from the landing page URL.

Authorizations

Authorization
string
header
required

This authentication parameter, used for access control, must be passed along with the request. To generate the authentication header, refer to Authentication.

It uses Workspace ID as username and Data API Key as password.

Headers

MOE-APPKEY
string
required

This is your MoEngage account's APP ID that has to be passed along with the request. You can find your MoEngage Workspace ID at Settings -> Account -> APIs -> Workspace ID (earlier app id).

Content-Type
string
default:application/json
required

Set the Content-Type header to application/json.

Query Parameters

user_id
string
required

This is the MoEngage ID that uniquely identifies the customer. Encrypted using 16 bits DES and encoded in the URL of the landing page.

cid
string
required

The campaign ID of the email campaign. Encrypted using 16 bits DES and encoded in the URL of the landing page.

moe_event_id
string

This is used to update the unsubscribe event when the user chooses the 'unsubscribe all' option.

Body

application/json

The user's updated preferences.

categories
object
required

This field contains the details about the updated subscription preferences of the user.

Example:
{
  "Promotions": true,
  "Updates": false,
  "Recommendations": true,
  "Newsletter": false
}
unsubscribe_all
boolean
required

This field contains information about whether or not a customer has unsubscribed from all categories.

When unsubscribe_all is true, the user is unsubscribed from all the categories, irrespective of the categories marked as true in the category JSON object.

Response

Success. This response is returned when the request is processed successfully.

message
string

A brief description of the request status in the case of success.