Skip to content

Award Points

POST /v1/points/award

Awards points to a user based on a configured reward rule. Creates the user automatically if they don’t exist. The number of points awarded is determined by the reward rule matching the eventType in your dashboard.

HeaderRequiredValue
X-API-SecretYesYour secret key
Content-TypeYesapplication/json
FieldTypeRequiredDescription
userIdstringYesThe user’s ID in your system
eventTypestringYesMust match a configured reward rule (e.g. signup, purchase, referral)
displayNamestringNoUser’s display name (created/updated on the user record)
emailstringNoUser’s email (created/updated on the user record)
metadataobjectNoArbitrary key-value data stored with the ledger entry
referencestringNoIdempotency key — duplicate references for the same event type are rejected
Terminal window
curl -X POST https://api.gamifyhost.com/v1/points/award \
-H "X-API-Secret: sk_live_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_12345",
"eventType": "signup",
"displayName": "Alice",
"email": "alice@example.com",
"metadata": {
"source": "ios_app",
"campaign": "summer_2025"
},
"reference": "ref_signup_user12345"
}'

Status: 200 OK

{
"message": "Points awarded successfully",
"code": 200,
"status": "success",
"data": {
"ledgerId": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"userId": "user_12345",
"eventType": "signup",
"pointsAwarded": 500,
"userBalance": 5500,
"reference": "ref_signup_user12345",
"createdAt": "2025-07-15T10:00:00Z"
}
}
FieldTypeDescription
ledgerIduuidUnique ledger entry ID
userIdstringThe user who received points
eventTypestringThe event type that triggered the award
pointsAwardedintegerNumber of points awarded (from the matching reward rule)
userBalanceintegerUser’s total balance after the award
referencestringThe idempotency reference (if provided)
createdAtdatetimeISO 8601 timestamp
CodeMessage
400Invalid request body / validation error
404No reward rule found for event type
409Duplicate reference — points already awarded for this reference