> For the complete documentation index, see [llms.txt](https://docs.terragon.io/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terragon.io/documents/terragon-api-document/game.md).

# Game

Game-related operations

## Get game by slug

> Retrieve game details by slug

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Game":{"type":"object","properties":{"id":{"type":"integer","description":"Game ID"},"name":{"type":"string","description":"Game name"},"provider_id":{"type":"integer","description":"Game provider ID"},"provider":{"$ref":"#/components/schemas/GameProvider"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/GameCategory"}},"thumbnail_url":{"type":"string","description":"Game thumbnail image URL"},"is_favorite":{"type":"boolean","description":"Whether the game is marked as favorite by the player"},"is_popular":{"type":"boolean","description":"Whether the game is popular"},"is_new":{"type":"boolean","description":"Whether the game is new"},"rtp":{"type":"number","format":"float","description":"Return to player percentage"}}},"GameProvider":{"type":"object","properties":{"id":{"type":"integer","description":"Game provider ID"},"name":{"type":"string","description":"Game provider name"}}},"GameCategory":{"type":"object","properties":{"id":{"type":"integer","description":"Game category ID"},"name":{"type":"string","description":"Game category name"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}}},"paths":{"/v1/games/{slug}":{"get":{"tags":["Game"],"summary":"Get game by slug","description":"Retrieve game details by slug","operationId":"getGameBySlug","parameters":[{"name":"slug","in":"path","required":true,"description":"Game slug","schema":{"type":"string"}}],"responses":{"200":{"description":"Game details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Game"}}}},"404":{"description":"Game not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Toggle game favorite status

> Toggle favorite status for a specific game

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Game":{"type":"object","properties":{"id":{"type":"integer","description":"Game ID"},"name":{"type":"string","description":"Game name"},"provider_id":{"type":"integer","description":"Game provider ID"},"provider":{"$ref":"#/components/schemas/GameProvider"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/GameCategory"}},"thumbnail_url":{"type":"string","description":"Game thumbnail image URL"},"is_favorite":{"type":"boolean","description":"Whether the game is marked as favorite by the player"},"is_popular":{"type":"boolean","description":"Whether the game is popular"},"is_new":{"type":"boolean","description":"Whether the game is new"},"rtp":{"type":"number","format":"float","description":"Return to player percentage"}}},"GameProvider":{"type":"object","properties":{"id":{"type":"integer","description":"Game provider ID"},"name":{"type":"string","description":"Game provider name"}}},"GameCategory":{"type":"object","properties":{"id":{"type":"integer","description":"Game category ID"},"name":{"type":"string","description":"Game category name"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}}},"paths":{"/v1/game/{id}/toggle-favorite":{"put":{"tags":["Game"],"summary":"Toggle game favorite status","description":"Toggle favorite status for a specific game","operationId":"toggleGameFavorite","parameters":[{"name":"id","in":"path","required":true,"description":"Game ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"Game favorite status toggled successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Game"}}}},"404":{"description":"Game not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get game assets

> Retrieve game assets

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GameAsset":{"type":"object","properties":{"id":{"type":"integer","description":"Game asset ID"},"game_id":{"type":"integer","description":"Game ID"},"type":{"type":"string","enum":["thumbnail","banner","logo"],"description":"Asset type"},"url":{"type":"string","description":"Asset URL"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}},"paths":{"/v1/game-assets":{"get":{"tags":["Game"],"summary":"Get game assets","description":"Retrieve game assets","operationId":"getGameAssets","responses":{"200":{"description":"Game assets retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GameAsset"}}}}}}}}}}}}
```

## Get favorite game assets

> Retrieve favorite game assets

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GameAsset":{"type":"object","properties":{"id":{"type":"integer","description":"Game asset ID"},"game_id":{"type":"integer","description":"Game ID"},"type":{"type":"string","enum":["thumbnail","banner","logo"],"description":"Asset type"},"url":{"type":"string","description":"Asset URL"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}},"paths":{"/v1/game-assets/favorites":{"get":{"tags":["Game"],"summary":"Get favorite game assets","description":"Retrieve favorite game assets","operationId":"getFavoriteGameAssets","responses":{"200":{"description":"Favorite game assets retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GameAsset"}}}}}}}}}}
```

## Get favorite games

> Retrieve list of favorite games

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Game":{"type":"object","properties":{"id":{"type":"integer","description":"Game ID"},"name":{"type":"string","description":"Game name"},"provider_id":{"type":"integer","description":"Game provider ID"},"provider":{"$ref":"#/components/schemas/GameProvider"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/GameCategory"}},"thumbnail_url":{"type":"string","description":"Game thumbnail image URL"},"is_favorite":{"type":"boolean","description":"Whether the game is marked as favorite by the player"},"is_popular":{"type":"boolean","description":"Whether the game is popular"},"is_new":{"type":"boolean","description":"Whether the game is new"},"rtp":{"type":"number","format":"float","description":"Return to player percentage"}}},"GameProvider":{"type":"object","properties":{"id":{"type":"integer","description":"Game provider ID"},"name":{"type":"string","description":"Game provider name"}}},"GameCategory":{"type":"object","properties":{"id":{"type":"integer","description":"Game category ID"},"name":{"type":"string","description":"Game category name"}}}}},"paths":{"/v1/game/favorites":{"get":{"tags":["Game"],"summary":"Get favorite games","description":"Retrieve list of favorite games","operationId":"getFavoriteGames","responses":{"200":{"description":"Favorite games retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Game"}}}}}}}}}}
```

## Get recent games

> Retrieve list of recently played games

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Game":{"type":"object","properties":{"id":{"type":"integer","description":"Game ID"},"name":{"type":"string","description":"Game name"},"provider_id":{"type":"integer","description":"Game provider ID"},"provider":{"$ref":"#/components/schemas/GameProvider"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/GameCategory"}},"thumbnail_url":{"type":"string","description":"Game thumbnail image URL"},"is_favorite":{"type":"boolean","description":"Whether the game is marked as favorite by the player"},"is_popular":{"type":"boolean","description":"Whether the game is popular"},"is_new":{"type":"boolean","description":"Whether the game is new"},"rtp":{"type":"number","format":"float","description":"Return to player percentage"}}},"GameProvider":{"type":"object","properties":{"id":{"type":"integer","description":"Game provider ID"},"name":{"type":"string","description":"Game provider name"}}},"GameCategory":{"type":"object","properties":{"id":{"type":"integer","description":"Game category ID"},"name":{"type":"string","description":"Game category name"}}}}},"paths":{"/v1/recent-games":{"get":{"tags":["Game"],"summary":"Get recent games","description":"Retrieve list of recently played games","operationId":"getRecentGames","responses":{"200":{"description":"Recent games retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Game"}}}}}}}}}}
```

## Get last game search

> Retrieve last game search results

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GameAsset":{"type":"object","properties":{"id":{"type":"integer","description":"Game asset ID"},"game_id":{"type":"integer","description":"Game ID"},"type":{"type":"string","enum":["thumbnail","banner","logo"],"description":"Asset type"},"url":{"type":"string","description":"Asset URL"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}},"paths":{"/v1/game-assets/last-search":{"get":{"tags":["Game"],"summary":"Get last game search","description":"Retrieve last game search results","operationId":"getLastGameSearch","responses":{"200":{"description":"Last game search retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GameAsset"}}}}}}}}}}
```

## Get last search for specific game

> Retrieve last search results for a specific game

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Game","description":"Game-related operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GameAsset":{"type":"object","properties":{"id":{"type":"integer","description":"Game asset ID"},"game_id":{"type":"integer","description":"Game ID"},"type":{"type":"string","enum":["thumbnail","banner","logo"],"description":"Asset type"},"url":{"type":"string","description":"Asset URL"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}}},"paths":{"/v1/games/{gameId}/last-search":{"get":{"tags":["Game"],"summary":"Get last search for specific game","description":"Retrieve last search results for a specific game","operationId":"getLastGameSearchById","parameters":[{"name":"gameId","in":"path","required":true,"description":"Game ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"Last game search retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GameAsset"}}}},"404":{"description":"Game not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
