Delete a single sweepstakes by providing the SweepstakesToken. This endpoint permanently removes the sweepstakes from the database.
POST sweepstakes/delete
This endpoint allows you to delete a sweepstakes and all its related data by providing the SweepstakesToken. The sweepstakes must belong to the authenticated user.
What gets deleted: Sweepstakes record, participants, entry pages, statistics, groups, rules, calendar events, short links, coupons, automations, and all related data.
Note: This action is permanent and cannot be undone.
| Parameter | Type | Required | Description |
|---|---|---|---|
SweepstakesToken |
String | Required | The unique identifier of the sweepstakes to delete |
{
"SweepstakesToken": "uuid-v4-string"
}curl -X POST "https://api-v3.sweeppea.com/sweepstakes/delete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"SweepstakesToken": "uuid-v4-string"
}'const response = await fetch('https://api-v3.sweeppea.com/sweepstakes/delete', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
SweepstakesToken: 'uuid-v4-string'
})
});
const data = await response.json();
console.log(data);import requests
import json
url = "https://api-v3.sweeppea.com/sweepstakes/delete"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"SweepstakesToken": "uuid-v4-string"
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.json())200 OK
{
"Response": true,
"Message": "Sweepstakes Deleted Successfully"
}401 Unauthorized
{
"Response": false,
"Message": "Invalid or Missing Bearer Token",
"Code": 401
}403 Forbidden
{
"Response": false,
"Message": "Invalid API Token",
"Code": 403
}400 Bad Request
{
"Response": false,
"Message": "Missing Required Parameter: SweepstakesToken",
"Code": 400
}404 Not Found
{
"Response": false,
"Message": "Sweepstakes Not Found",
"Code": 404
}