Delete Scheduled Drawing
Delete a pending scheduled winner drawing for a specific sweepstakes. This endpoint allows you to remove scheduled drawings that have not been executed yet.
DELETE
https://api-v3.sweeppea.com/winners/deletescheduled
Description
This endpoint allows you to delete a scheduled drawing that is in pending status. Only drawings with Status 0 (Pending) can be deleted. Completed or errored drawings cannot be removed.
Important Notes:
- The sweepstakes must belong to the authenticated user
- Only pending drawings (Status 0) can be deleted
- Completed or errored drawings cannot be removed
- The scheduled drawing must exist for the specified sweepstakes
Request Body Parameters
Parameter Casing: All request parameters are PascalCase. For backward compatibility, camelCase equivalents (e.g. sweepstakesToken) are also accepted.
| Parameter | Type | Required | Description |
|---|---|---|---|
SweepstakesToken |
String (UUID v4) | Yes | The unique identifier of the sweepstakes |
ScheduleToken |
String (UUID v4) | Yes | The unique identifier of the scheduled drawing to delete |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
SweepstakesToken |
String (UUID v4) | Yes | The unique identifier of the sweepstakes |
ScheduleToken |
String (UUID v4) | Yes | The unique identifier of the scheduled drawing to delete |
Code Examples
curl -X DELETE "https://api-v3.sweeppea.com/winners/deletescheduled" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"SweepstakesToken": "uuid-v4-string",
"ScheduleToken": "uuid-v4-string"
}'
const response = await fetch('https://api-v3.sweeppea.com/winners/deletescheduled', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
SweepstakesToken: "uuid-v4-string",
ScheduleToken: "uuid-v4-string"
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api-v3.sweeppea.com/winners/deletescheduled"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"SweepstakesToken": "uuid-v4-string",
"ScheduleToken": "uuid-v4-string"
}
response = requests.delete(url, headers=headers, json=data)
print(response.json())
Response
{
"Response": true,
"Message": "Scheduled drawing deleted successfully"
}
Error Responses
{
"Response": false,
"Message": "Missing or invalid Bearer token. Send your API token in the Authorization header as: Authorization: Bearer YOUR_API_TOKEN",
"Code": 401
}
{
"Response": false,
"Message": "Invalid API token",
"Code": 403
}
{
"Response": false,
"Message": "Missing SweepstakesToken or ScheduleToken in request body",
"Help": {
"ExpectedBody": {
"SweepstakesToken": "string (required) \u2014 UUID v4 of the sweepstakes",
"ScheduleToken": "string (required) \u2014 UUID v4 of the scheduled drawing. Only a PENDING drawing can be deleted"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Sweepstakes not found",
"Code": 404
}
{
"Response": false,
"Message": "You do not have permission to access this sweepstakes",
"Code": 403
}
{
"Response": false,
"Message": "Scheduled drawing not found",
"Code": 404
}
{
"Response": false,
"Message": "Cannot delete scheduled drawing. Only pending drawings can be deleted",
"Help": {
"ExpectedBody": {
"SweepstakesToken": "string (required) \u2014 UUID v4 of the sweepstakes",
"ScheduleToken": "string (required) \u2014 UUID v4 of the scheduled drawing. Only a PENDING drawing can be deleted"
}
},
"Code": 400
}