Delete Rules
Delete official rules for a specific sweepstakes. The rule must belong to the authenticated user and the specified sweepstakes.
POST
/rules/delete
Description
This endpoint deletes a specific official rule document. The rule must exist for the authenticated user and the specified sweepstakes token. All three parameters (UserToken via API token, SweepstakesToken, and RulesToken) must match for the deletion to succeed.
Authentication
This endpoint requires Bearer token authentication via the Authorization header.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
SweepstakesToken |
String (UUID v4) | Yes | The unique identifier of the sweepstakes |
RulesToken |
String (UUID v4) | Yes | The unique identifier of the rule to delete |
Code Examples
curl -X POST "https://api-v3.sweeppea.com/rules/delete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"SweepstakesToken": "YOUR_SWEEPSTAKES_TOKEN",
"RulesToken": "YOUR_RULES_TOKEN"
}'
Response
200 OK
{
"Response": true,
"Message": "Rule Deleted Successfully"
}
Error Responses
400 Bad Request
{
"Response": false,
"Message": "SweepstakesToken is Required",
"Code": 400
}
{
"Response": false,
"Message": "RulesToken is Required",
"Code": 400
}
401 Unauthorized
{
"Response": false,
"Message": "Invalid or Missing Bearer Token",
"Code": 401
}
403 Forbidden
{
"Response": false,
"Message": "Invalid API Token",
"Code": 403
}
404 Not Found
{
"Response": false,
"Message": "Rule Not Found",
"Code": 404
}
500 Internal Server Error
{
"Response": false,
"Message": "Internal Server Error",
"Code": 500
}