Skip to content

List Code Batches

GET /v1/campaigns/codes/batches

Returns a paginated list of code batches for the campaign. Each batch contains metadata about when it was created, how many codes were generated, and their point value.

HeaderRequiredValue
X-API-SecretYesYour secret key
ParameterTypeRequiredDefaultDescription
slugstringYesCampaign slug
pageintegerNo1Page number
limitintegerNo20Items per page
Terminal window
curl -X GET "https://api.gamifyhost.com/v1/campaigns/codes/batches?slug=summer-promo&page=1&limit=10" \
-H "X-API-Secret: sk_live_your_secret_key"

Status: 200 OK

{
"status": "success",
"data": {
"batches": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"campaignId": "c1d2e3f4-a5b6-7890-1234-567890abcdef",
"batchSize": 100,
"pointsValue": 500,
"label": "In-store promo cards",
"expiresAt": "2025-12-31T23:59:59Z",
"createdAt": "2025-07-15T10:00:00Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"campaignId": "c1d2e3f4-a5b6-7890-1234-567890abcdef",
"batchSize": 50,
"pointsValue": 200,
"label": "Email campaign July",
"expiresAt": null,
"createdAt": "2025-07-10T14:30:00Z"
}
],
"total": 2,
"page": 1,
"limit": 10
}
}
CodeMessage
404Campaign not found