Delete User

Overview

This API can be used to delete users in MoEngage. Users cannot be retrieved once deleted. Users deleted (hard delete) using this API will be deleted after a default buffer of 24 hours. During this buffer period, the user will still be active in MoEngage and will be visible in Segments, Analytics, and Campaigns. Users can be updated in the buffer period.
After the buffer elapses, the user is hard-deleted from MoEngage. If a user with the same unique identifiers as the deleted one is created in MoEngage (through APIs or imports), they will be created again in MoEngage.

UserDelete_Process.png

API Endpoint

API Endpoint
https:/api-0X.moengage.com/v1/customer/delete?app_id=<APP_ID>

Each customer is hosted on a different data center; you can find your data center number (value of X) by checking the data center and API endpoint mapping page.

Authentication

The API requests will be authenticated through Basic Authentication.

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 bmF2ZWVua3VtYXI6bW9lbmdhZ2U="}

The username and password details can be obtained from the MoEngage Dashboard. We've revamped the settings UI in the Dashboard. If you're using the API for the first time, follow these steps for the revamped and old UIs:

Revamped UI

  1. Navigate to Settings -> Account -> APIs.
  2. Click Generate Key in the Data tile in the API Keys section, and click Save.
  3. Use the App ID as the username and the Data API Key as the password to generate the authentication header.

Old UI

  1. Navigate to Settings -> APIs -> DATA API Settings.
  2. Click Generate Key.
  3. Click Save on the Data APIs settings section. 
  4. Use the DATA API ID as the username and the DATA API KEY as the password to generate the authentication header.

Request Parameters

Key Type Value Description

APP_ID

Mandatory

String

This is your MoEngage account's APP ID that has to be passed along with the request.

You can find your MoEngage APP ID in the following navigation on the Dashboard:

Revamped UI: Settings -> Account -> APIs -> App ID

Old UI: Settings -> API -> General Settings -> DATA API

Request Headers

Key Sample Values Description

X-Forwarded-For

Header Value Format: <IP Address>

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.

Content-Type

application/json 

Set the Content-Type header to application/json for using the Bulk Update Preferences API.

Authorization

{"Authorization": "Basic bmF2ZWVua3VtYXI6bW9lbmdhZ2U=="}

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

Request Body

Key Required Data Type Description

identity_type

 Yes

String

This field specifies the identifier type. Identifier types can either be customer_id (ID field in the User Profile) or moengage_id (the MoEngageID of the user in the User Profile).

Allowed Values: moengage_id, customer_id

Example: "identity_type": "moengage_id"

identity_value

Yes

String

This field specifies the unique identifier that identifies the user.

Example: "identity_value": "6416d1a318r98264512c0f89"

Response

Key Data Type Description

status

String

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

Supported Values: success, fail

Example: "status": "success"

message

String

This field contains information about whether the response is being processed, the user is deleted, and so on.

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

error

String

This field is present in the response only in the case of errors and contains the error message.

Structure:

"error": {

"message": "<Error Message>",

"type": "<Error Type>",

"request_id": "<Request ID>"

}

message - This field contains the error message and describes the reason for the error.

type - This field contains the type of error, such as Authentication Required, Invalid Params, and so on.

request_id - This field contains the request-id that identifies the request uniquely.

title

String

This field is present in the response in the case of 429 and 5xx errors and contains the type of error.

description

String

This field is present in the response in the case of 429 and 5xx errors and contains the error description.

Response Codes

Status Code Request State Description

200

Success

This response is returned when the request is processed successfully. 

400

Bad Request

This response is returned when the required parameters APP KEY, user_id, etc are missing from the request or when the provided params are invalid.

401

Authorization Failure

This response is returned when the authorization fails due to incorrect values for the APP KEY/ HTTP Auth Header.

403

Account Blocked

This response is returned when your MoEngage account has been blocked or suspended.

429

Rate Limit Breach

This response is returned when the number of requests per minute has exceeded the rate limit.

5xx

Internal Server Error

This response is returned when the system runs into an unexpected error.

Rate Limit

The rate limit is 1 user per payload and 5000 requests per minute.

Sample cURL Request

cURL
curl --location 'https://api-{{0X}}.moengage.com/v1/customer/delete?app_id={{APP_ID}}' \
--header 'X-Forwarded-For: 34.249.175.81' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic e3tEQVRBIEFQSSBJRH19Ont7REFUQSBBUEkgS0VZfX0=' \
--data '{
    "identity_type": "moengage_id/customer_id",
    "identity_value": "{{moengage_user_id_or_uid_that_you_want_to_delete}}"
}
'

Sample Response

200 400 401 403 429 500
Success Response
{ "status": "success", "message": "Your request has been accepted and will be processed soon." }

Postman Collections

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

FAQs

  1. Can you reverse a delete operation?

    There are no rollback mechanisms for undoing the delete action. Once the delete request is processed, the user is deleted from MoEngage.

  2. Are the events of the users also deleted as well?

    No, the events corresponding to a user are not deleted; only the user and the user attributes are deleted when the delete request is processed.

  3. How do you check if a user has been deleted from MoEngage?

    Navigate to Segment -> Create Segment on the MoEngage Dashboard. Type the unique identifier for the deleted user (the unique identifier could be the ID, MoEngage ID, phone number, email, or any unique identifer that you've configured). If the user has been deleted (hard delete), you will not be able to get any search results. For more information about searching users, refer to Search User in Segmentation.

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?