Delete profile with server-side API
Deletes an end user of your app in Adapty.
Calling this endpoint enables the deletion of a user's profile and all related data, rendering it inaccessible to the client. Any profile history linked to the deleted profile will be detached, and integration events previously sent to integrations will be deleted from the event feed.
Should another profile make a purchase from the device with the same Apple ID (or when the subscription is restored), the profile history will be reassigned to the new profile, and integration events will be reissued.
Please be aware that this endpoint does not support bulk deletion, therefore each request must be handled individually. For managing a substantial number of users, it is advisable to execute requests concurrently.
Method and endpoint
DELETE https://api.adapty.io/api/v2/server-side-api/profile/
Example request
- cURL
- Python
- JavaScript
curl --location --request DELETE 'https://api.adapty.io/api/v2/server-side-api/profile/' \
--header 'adapty-customer-user-id: <YOUR_CUSTOMER_USER_ID>' \
--header 'adapty-platform: iOS' \
--header 'Content-Type: application/json' \
--header 'adapty-profile-id: <YOUR_USER_PROFILE_ID>' \
--header 'Authorization: Api-Key <YOUR_SECRET_API_KEY>' \
--data ''
import requests
import json
url = "https://api.adapty.io/api/v2/server-side-api/profile/"
payload = ""
headers = {
'adapty-customer-user-id': '<YOUR_CUSTOMER_USER_ID>',
'adapty-platform': 'iOS',
'Content-Type': 'application/json',
'adapty-profile-id': '<YOUR_USER_PROFILE_ID>',
'Authorization': 'Api-Key <YOUR_SECRET_API_KEY>'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
const myHeaders = new Headers();
myHeaders.append("adapty-customer-user-id", "<YOUR_CUSTOMER_USER_ID>");
myHeaders.append("adapty-platform", "iOS");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("adapty-profile-id", "<YOUR_USER_PROFILE_ID>");
myHeaders.append("Authorization", "Api-Key <YOUR_SECRET_API_KEY>");
const raw = "";
const requestOptions = {
method: "DELETE",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://api.adapty.io/api/v2/server-side-api/profile/", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
Parameters
No parameters
Successful response
204 No Content with an empty body is a successful response.
Errors
401 - Unauthorized
The request failed due to missing or incorrect authorization. Check the Authorization page, paying close attention to the Authorization header.
The request also failed because the specified profile wasn’t found.
Body:
Parameter | Type | Description |
---|---|---|
errors | Object |
|
error_code | String | Short error name. Always not_authenticated . |
status_code | Integer | HTTP status. Always 401. |
Response example:
{
"errors": [
{
"source": "non_field_errors",
"errors": [
"Authentication credentials were not provided."
]
}
],
"error_code": "not_authenticated",
"status_code": 401
}
404 - Not found
The request failed because the specified profile wasn’t found.
Body
Parameter | Type | Description |
---|---|---|
errors | Object |
|
error_code | String | Short error name. Always not_found . |
status_code | Integer | HTTP status. Always 404 . |
Response example
{
"errors": [
{
"source": "non_field_errors",
"errors": [
"Not found."
]
}
],
"error_code": "not_found",
"status_code": 404
}
See also: