Create Group

Create a new group for a sweepstakes. Groups allow you to organize and segment participants within your sweepstakes.

POST groups/create

Description

This endpoint allows you to create a new group for a specific sweepstakes. The group will be associated with the authenticated user and the specified sweepstakes. Use this to manage your participants & groups data programmatically through the Sweeppea API.

Request Parameters

Parameter Type Required Description
sweepstakesToken String (UUID v4) Required The UUID token of the sweepstakes where the group will be created
groupName String Required The name of the group (must be unique within the sweepstakes)

Code Examples

curl -X POST "https://api-v3.sweeppea.com/groups/create" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "sweepstakesToken": "uuid-v4-string", "groupName": "VIP Members" }'

Response

200 OK

{ "Response": true, "Data": { "GroupToken": "uuid-v4-string", "GroupName": "VIP Members", "SweepstakesToken": "uuid-v4-string", "Primary": false, "Locked": false, "CreationDate": "2026-01-15T13:13:42.851Z" }, "Message": "Group created successfully" }

Error Responses

400 Bad Request
{ "Response": false, "Message": "Missing required parameters: sweepstakesToken and groupName" }

400 Bad Request - Duplicate Name

{ "Response": false, "Message": "Group name already exists for this sweepstakes" }

401 Unauthorized

{ "Response": false, "Message": "Invalid or Missing Bearer Token", "Code": 401 }

403 Forbidden

{ "Response": false, "Message": "Invalid API token" }

404 Not Found

{ "Response": false, "Message": "Sweepstakes not found or does not belong to user" }