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: application/json' \
  --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.

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

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.