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.

Optionally, you can send a one-time play link via email that allows the user to play games directly without embedding the widget in your app.

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 (required if sendPlayLink is true)
metadataobjectNoArbitrary key-value data stored with the ledger entry
referencestringNoIdempotency key — duplicate references for the same event type are rejected
sendPlayLinkbooleanNoIf true, generates a one-time play link and sends it to the user’s email
linkExpiresInHoursintegerNoLink expiration time in hours (1-720). Default: 48
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"
}'
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",
"reference": "ref_signup_user12345",
"sendPlayLink": true,
"linkExpiresInHours": 72
}'

Status: 201 Created

{
"message": "Points awarded successfully",
"code": 201,
"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"
}
}

When sendPlayLink: true and email is provided:

{
"message": "Points awarded successfully",
"code": 201,
"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",
"playLink": {
"url": "https://play.gamifyhost.com/play?token=...",
"expiresAt": "2025-07-18T10:00:00Z",
"emailSent": true
}
}
}
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
playLinkobjectPresent only when sendPlayLink is true and email is provided
playLink.urlstringThe one-time play link URL
playLink.expiresAtdatetimeWhen the link expires
playLink.emailSentbooleanWhether the email was sent successfully
  • The link opens the GamifyHost play app at play.gamifyhost.com and automatically initializes the widget with the user’s context
  • The user can immediately start playing games using their awarded points
  • Partners can customize the email content (subject, heading, body, CTA text) via the dashboard under Rewards → Message Template
  • If you have branding configured (logo, colors), both the email and the play app will reflect your brand
  • If the link expires or has already been used, the user sees a friendly error message

Email Campaigns: Award points for completing a survey, then send a play link so users can redeem rewards without logging into your app.

Referral Programs: When a user refers a friend, award them points and send a play link via email so they can play games immediately.

Re-engagement: Award inactive users bonus points and send them a play link to bring them back.

No-App Integration: If you don’t have a mobile app or website where you can embed the widget, use play links to let users access games via email.

CodeMessage
400Invalid request body / validation error
404No reward rule found for event type
409Duplicate reference — points already awarded for this reference