Count Participants

Count Participants API endpoint for Sweeppea. POST /participants/count. Complete documentation with code examples in cURL, JavaScript, and Python.

POST participants/count

Description

This endpoint allows you to count participants in a sweepstakes. You can filter by participant type (participants, AMOE participants, opt-outs, or all) and apply date range filters. Use this to get statistics about your sweepstakes participants programmatically through the Sweeppea API.

Request Body Parameters

Parameter Type Required Description
SweepstakesToken String (UUID v4) Yes Unique identifier for the sweepstakes
FilterType String No Type of count: "all", "participants", "amoe", "optouts" (default: "all")
StartDate String (ISO 8601) No Start date for filtering participants (e.g., "2025-01-01")
EndDate String (ISO 8601) No End date for filtering participants (e.g., "2025-12-31")

Code Examples

curl -X POST "https://api-v3.sweeppea.com/participants/count" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "SweepstakesToken": "uuid-v4-string", "FilterType": "all", "StartDate": "2025-01-01", "EndDate": "2025-12-31" }'

Response

200 OK

{ "Response": true, "Data": { "SweepstakesToken": "uuid-v4-string", "FilterType": "all", "DateRange": { "StartDate": "2025-01-01", "EndDate": "2025-12-31" }, "Counts": { "Participants": 1250, "AmoeParticipants": 85, "OptOuts": 42, "Total": 1377 } } }
Filter Type Examples

Count Only Participants:

{ "SweepstakesToken": "uuid-v4-string", "FilterType": "participants" }

Count Only AMOE Participants:

{ "SweepstakesToken": "uuid-v4-string", "FilterType": "amoe" }

Count Only Opt-Outs:

{ "SweepstakesToken": "uuid-v4-string", "FilterType": "optouts" }
Error Responses

400 Bad Request

{ "Response": false, "Message": "Invalid or Missing SweepstakesToken", "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": "Sweepstakes Not Found or Access Denied", "Code": 404 }