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.

To generate the Basic Authentication header:

  1. Navigate to Settings > APIs > DATA API Settings
  2. Copy the DATA API ID and DATA API KEY
  3. Generate the Authentication Header String
    Basic Authentication encodes a 'username:password' using base64 and prepends it with the string 'Basic '. To generate the Auth header:
    • Add a colon after the user name (DATA API ID) and concatenate it with the password (DATA API KEY).
    • Encode the concatenated string using base64 encoding.
    • Pass the encoded string in the HTTP authorization header as follows: {"Authorization":" Basic bmF2ZWVua3VtYXI6bW9lbmdhZ2U=="}

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 MoEngage Dashboard API Settings. Navigation: Settings -> API -> General Settings -> DATA API section. For more information, refer to Authentication.

Note: You can also fetch the APP ID from the following navigation: Settings -> App -> General Settings.

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 is the authentication parameter for access control and needs to be passed along with the request. The APP ID and API SECRET need to be picked up from the DATA API Settings in the MoEngage Dashboard, and a Basic Authorization header needs to be created and set in the header. Navigation: Settings -> API -> General Settings -> DATA API section. For more information, 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?