Delete Users
How to bulk delete users
This guide will go over how to delete user records in bulk from OneSignal. If you want to delete segments without the user records see Deleting Segments.
If you would like to delete users from our API, see the API Delete Device Call. Currently you can only delete individual user records from the API.
Note: We may delete users in apps that we deem as being “inactive,” in-line with our Data Access and Retention Policy located in the OneSignal Privacy Policy
Deleting users cannot be reversed!
Once you delete users, there is no way to get them back. Deleted users can only get push again once they:
- Web: Clear browser cookies, then return to your site
- Mobile: Open the app again. We recommend being up to date on the latest version of OneSignal's SDK in the app.
WARNING: DO NOT DELETE ALL USERS
Be very careful when following these steps, make sure you do not delete all users.
Delete Bulk Users From the OneSignal Dashboard
Create Your Segment
See Segments for details on creating segments. We recommend using the "Last Session" filter with greater than 4320 hours (6 months). Make sure to select greater than and NOT "less than".
Before deletion, we also recommend sending 2 notifications to this segment to try winning those users back.
When ready, select the 3-dot Options button > View Users

In Audience > All Users
- Check that the correct Segment is selected.
- Select the arrow next to 'Update/Import Users' to reveal the dropdown
- Select Delete Users In Segment

A confirmation screen will appear showing how many users will be deleted and require you to input the name of the segment to confirm deletion.
WARNING: POINT OF NO RETURN!
Once you press Delete Users this cannot be undone. Your users will be deleted.

After clicking Delete Users a confirmation screen will appear and you will be sent an email confirming the deletion.
You cannot delete more than 1 segment at a time per app.
API Deletion Requirements
Example API DELETE User Endpoint
Deletion of devices cannot be undone
Once you delete a device, you cannot get the device record back unless the device:
- Clears browser cookies, then return to your site
- Uninstall the app and re-install the app.
curl --include \
--request DELETE \
--header "Authorization: Basic YOUR_ONESIGNAL_API_KEY" \
https://onesignal.com/api/v1/players/ONESIGNAL_PLAYER_ID?app_id=YOUR_APP_ID
Delete Users With Postman
Requirements:
1 - Postman: download postman here (free) https://www.getpostman.com/
2 - The OneSignal Player Ids to be deleted. Can be a CSV file of devices.
Step 1 - Setup Postman Collection
Open Postman app. Select "New Collection" and name it "Delete OneSignal Users"
Click "Add requests" and also name this "Delete OneSignal Users".
Save

Step 2 Setup Postman Request
In the request under "Params"
- Select DELETE
- Add the URL
https://onesignal.com/api/v1/players/:player_id?app_id=YOUR_APP_ID
- Replace "YOUR_APP_ID" with the actual OneSignal App Id for your
- Set the value for "player_id" to be
{{player_id}}

- Select "Headers"
- Select
Authorization
- Type
Basic YOUR_REST_API_KEY
but changeYOUR_REST_API_KEY
to your actual REST API key that matches the app id from step 3. - Save the request

Step 3 Add your player_id
You can individually delete devices by replacing the {{player_id}}
with the actual player_id of the device you want deleted. Then click the "Send" button to delete it.

Finished individual deletion
If you did the individual deletion, you are all done! You can continue adding player ids to delete.
If you want to delete large amounts of player ids at once continue here:
You can run a list of player_id's unto postman to delete. Make sure your CSV file has 1 column with player_id
as the column header. It must looks like this:

Step 4 Run the Request
Next to the Collection, select the arrow and choose "Run"

This will open a new window. Next to:
Delay use 500 ms
Data click "Select File" and Open the .csv file of your segment.
Check Keep variable values
Uncheck "Save cookies after collection run"

DELETION PROCESS
Below is the final step. Once you select the next button the deletion process will occur.
Selecting the blue "Run Delete OneSignal Users" button will start the deletion process for all users in that csv.

Step 5 Review
That is it, you have now deleted those records from OneSignal.
You can watch the process and as long as you see "200 OK"s then you are all set.

Updated 5 months ago