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 'Authorization: Api-Key <YOUR_SECRET_API_KEY>' \
--header 'adapty-customer-user-id: <YOUR_CUSTOMER_USER_ID>' \
--header 'Content-Type: application/json' \
--data ''
import requests
url = "https://api.adapty.io/api/v2/server-side-api/profile/"
headers = {
"Authorization": "Api-Key <YOUR_SECRET_API_KEY>",
"adapty-customer-user-id": "<YOUR_CUSTOMER_USER_ID>",
"Content-Type": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.text)
const myHeaders = new Headers();
myHeaders.append("Authorization", "Api-Key <YOUR_SECRET_API_KEY>");
myHeaders.append("adapty-customer-user-id", "<YOUR_CUSTOMER_USER_ID>");
myHeaders.append("Content-Type", "application/json");
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));
Placeholders:
<YOUR_CUSTOMER_USER_ID>
: The unique ID of the customer in your system.<YOUR_SECRET_API_KEY>
: Your secret API key for authorization.
Parameters
No parameters
Successful response: 204: No Content
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. Double-check the customer_user_id
or profile_id
for any typos.
Body
Parameter | Type | Description |
---|---|---|
errors | Object |
|
error_code | String | Short error name. Always profile_does_not_exist . |
status_code | Integer | HTTP status. Always 404 . |
Response example
{
"errors": [
{
"source": null,
"errors": [
"Profile not found"
]
}
],
"error_code": "profile_does_not_exist",
"status_code": 404
}
See also: