GET /api/games
Retrieves all games from the database with their details including title, explanation, points reward, and category information.
Authentication
No authentication required.
Request
No parameters required.
Response
Array of game objects
Unique identifier for the game
Game title (max 100 characters)
Game description or instructions (max 80 characters)
Points awarded for completing the game (max 9 characters)
Foreign key reference to the game category
Associated category object
Timestamp when the game was created
Timestamp when the game was last updated
Response Example
[
{
"id": 1,
"title": "Math Quiz Challenge",
"explanation": "Solve mathematical problems to earn points",
"points_reward": "100",
"categoryId": 1,
"category": {
"id": 1,
"name": "Mathematics"
},
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
},
{
"id": 2,
"title": "Science Trivia",
"explanation": "Test your science knowledge",
"points_reward": "150",
"categoryId": 2,
"category": {
"id": 2,
"name": "Science"
},
"createdAt": "2026-01-16T14:20:00.000Z",
"updatedAt": "2026-01-16T14:20:00.000Z"
}
]
Status Codes
Games retrieved successfully
Games not found{
"error": "Games not found"
}
cURL Example
curl -X GET https://api.cognit.com/api/games