Add Participant
Add Participant API endpoint for Sweeppea. POST participants/add. Complete documentation with code examples in cURL, JavaScript, and Python.
POST
participants/add
Description
This endpoint allows you to add participants to your sweepstakes. Use this to manage your participants & groups data programmatically through the Sweeppea API.
warning
Important Note:
- Field names with multiple words (e.g., "First Name") must have spaces replaced with underscores (e.g., "First_Name")
- Fields must match exactly with the Entry Page fields in the same order and structure
- To obtain the correct field mapping for your sweepstakes, consult the Fetch Entry Page Fields endpoint
Code Examples
curl -X POST "https://api-v3.sweeppea.com/participants/add" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lang": "EN",
"source": "api",
"sweepstakesToken": "uuid-v4-string",
"entryPageFields": {
"KeyPhoneNumber": "5551234567",
"KeyEmail": "john.doe@example.com",
"BonusEntries": 0,
"Fields": {
"First_Name": "John",
"Last_Name": "Doe",
"City": "New York",
"State": "NY"
}
}
}'
Response
200 OK
{
"Response": true,
"Message": "(OK) Participant successfully added to your sweepstakes."
}
Error Responses
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": "Invalid parameters in body object, read documentation.",
"Code": 400
}
401 Unauthorized
{
"Response": false,
"Message": "Invalid or Missing Bearer Token",
"Code": 401
}
403 Forbidden
{
"Response": false,
"Telemetry": {
"DataConsumed": 1234,
"APICalls": 1000,
"MaxAPICalls": 1000
},
"Message": "You have reached the maximum API calls allowed for this month. Contact support for more information."
}
404 Not Found
{
"Response": false,
"Message": "User Not Found",
"Code": 404
}