Sweeppea API v3

Delete Rules

Delete official rules for a specific sweepstakes. The rule must belong to the authenticated user and the specified sweepstakes.

POST https://api-v3.sweeppea.com/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

{
  "Response": true,
  "Message": "Rule Deleted Successfully"
}

Error Responses

{
  "Response": false,
  "Message": "SweepstakesToken is Required",
  "Help": {
    "ExpectedBody": {
      "SweepstakesToken": "string (required) \u2014 UUID v4 of the sweepstakes",
      "RulesToken": "string (required) \u2014 UUID v4 of the rules document"
    }
  },
  "Code": 400
}
{
  "Response": false,
  "Message": "RulesToken is Required",
  "Help": {
    "ExpectedBody": {
      "SweepstakesToken": "string (required) \u2014 UUID v4 of the sweepstakes",
      "RulesToken": "string (required) \u2014 UUID v4 of the rules document"
    }
  },
  "Code": 400
}
{
  "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. It does not match any account.",
  "Code": 403
}
{
  "Response": false,
  "Message": "Rule Not Found",
  "Code": 404
}
{
  "Response": false,
  "Message": "Internal server error. Please try again; if it persists, contact support with the time of this request.",
  "Code": 500
}
© Sweeppea. All rights reserved.