Skip to content

Get User History

GET /v1/users/:userId/history

Returns a paginated ledger of all point transactions for a user, including points awarded via events and points spent on games.

HeaderRequiredValue
X-API-SecretYesYour secret key
ParamTypeDescription
userIdstringThe user’s external ID
ParamTypeDefaultDescription
pageinteger1Page number
limitinteger20Results per page
Terminal window
curl -X GET "https://api.gamifyhost.com/v1/users/user_12345/history?page=1&limit=10" \
-H "X-API-Secret: sk_live_your_secret_key"

Status: 200 OK

{
"message": "User history retrieved",
"code": 200,
"status": "success",
"data": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"eventType": "signup",
"points": 500,
"reference": "ref_signup_user12345",
"metadata": {
"source": "ios_app"
},
"createdAt": "2025-07-15T10:00:00Z"
},
{
"id": "a9b8c7d6-e5f4-3210-fedc-ba0987654321",
"eventType": "purchase",
"points": 100,
"reference": "order_98765",
"metadata": {
"orderId": "98765",
"amount": 49.99
},
"createdAt": "2025-07-15T11:30:00Z"
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 12,
"totalPages": 2
}
}
FieldTypeDescription
iduuidLedger entry ID
eventTypestringEvent that triggered the points
pointsintegerPoints awarded (positive) or spent (negative)
referencestringIdempotency reference (if provided)
metadataobjectArbitrary metadata attached to the entry
createdAtdatetimeISO 8601 timestamp
CodeMessage
404User not found