Skip to content

Code Statistics

GET /v1/campaigns/codes/stats

Returns aggregate statistics about all codes generated for a campaign, broken down by status.

HeaderRequiredValue
X-API-SecretYesYour secret key
ParameterTypeRequiredDescription
slugstringYesCampaign slug
Terminal window
curl -X GET "https://api.gamifyhost.com/v1/campaigns/codes/stats?slug=summer-promo" \
-H "X-API-Secret: sk_live_your_secret_key"

Status: 200 OK

{
"status": "success",
"data": {
"totalCodes": 150,
"activeCodes": 120,
"redeemedCodes": 25,
"expiredCodes": 3,
"revokedCodes": 2,
"totalBatches": 3
}
}
FieldTypeDescription
totalCodesintegerTotal codes generated across all batches
activeCodesintegerCodes available for redemption
redeemedCodesintegerCodes that have been redeemed
expiredCodesintegerCodes that have expired
revokedCodesintegerCodes that were manually revoked
totalBatchesintegerNumber of code batches generated
CodeMessage
404Campaign not found