# Games

Game management and retrieval operations

## Get games

> Retrieve all active games or all games (including inactive) with the 'all' query parameter

```json
{"openapi":"3.0.3","info":{"title":"Exploration Games API","version":"1.0.0"},"tags":[{"name":"Games","description":"Game management and retrieval operations"}],"servers":[{"url":"https://exploration-games.decentraland.org","description":"Production server"},{"url":"https://exploration-games.decentraland.zone","description":"Development server"}],"security":[],"paths":{"/api/games":{"get":{"tags":["Games"],"summary":"Get games","description":"Retrieve all active games or all games (including inactive) with the 'all' query parameter","operationId":"getGames","parameters":[{"name":"all","in":"query","description":"Include inactive games","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"List of games","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique game identifier"},"name":{"type":"string","description":"Game name"},"parcel":{"type":"string","description":"Decentraland parcel coordinates"},"active":{"type":"boolean","description":"Whether the game is active"}},"required":["id","name","parcel","active"]}}}}}}}}}}}}
```

## Create a new game

> Create a new game at a specific parcel location (Admin only)

```json
{"openapi":"3.0.3","info":{"title":"Exploration Games API","version":"1.0.0"},"tags":[{"name":"Games","description":"Game management and retrieval operations"}],"servers":[{"url":"https://exploration-games.decentraland.org","description":"Production server"},{"url":"https://exploration-games.decentraland.zone","description":"Development server"}],"security":[],"paths":{"/api/games":{"post":{"tags":["Games"],"summary":"Create a new game","description":"Create a new game at a specific parcel location (Admin only)","operationId":"createGame","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Game name"},"x":{"type":"integer","description":"X coordinate of the parcel","minimum":-150,"maximum":150},"y":{"type":"integer","description":"Y coordinate of the parcel","minimum":-150,"maximum":150}},"required":["name","x","y"]}}}},"responses":{"201":{"description":"Game created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique game identifier"},"name":{"type":"string","description":"Game name"},"parcel":{"type":"string","description":"Decentraland parcel coordinates"},"active":{"type":"boolean","description":"Whether the game is active"}},"required":["id","name","parcel","active"]}}}}}},"400":{"description":"Invalid request payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description"}}}}}}}}}}}
```

## Update a game

> Update game name and parcel location (Admin only)

```json
{"openapi":"3.0.3","info":{"title":"Exploration Games API","version":"1.0.0"},"tags":[{"name":"Games","description":"Game management and retrieval operations"}],"servers":[{"url":"https://exploration-games.decentraland.org","description":"Production server"},{"url":"https://exploration-games.decentraland.zone","description":"Development server"}],"security":[],"paths":{"/api/games/{id}":{"patch":{"tags":["Games"],"summary":"Update a game","description":"Update game name and parcel location (Admin only)","operationId":"updateGame","parameters":[{"name":"id","in":"path","description":"Game ID (UUID)","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Game name"},"x":{"type":"integer","description":"X coordinate of the parcel","minimum":-150,"maximum":150},"y":{"type":"integer","description":"Y coordinate of the parcel","minimum":-150,"maximum":150}},"required":["name","x","y"]}}}},"responses":{"204":{"description":"Game updated successfully"},"400":{"description":"Invalid request or game not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description"}}}}}}}}}}}
```

## Deactivate a game

> Deactivate a game by ID (Admin only)

```json
{"openapi":"3.0.3","info":{"title":"Exploration Games API","version":"1.0.0"},"tags":[{"name":"Games","description":"Game management and retrieval operations"}],"servers":[{"url":"https://exploration-games.decentraland.org","description":"Production server"},{"url":"https://exploration-games.decentraland.zone","description":"Development server"}],"security":[],"paths":{"/api/games/{id}/deactivate":{"patch":{"tags":["Games"],"summary":"Deactivate a game","description":"Deactivate a game by ID (Admin only)","operationId":"deactivateGame","parameters":[{"name":"id","in":"path","description":"Game ID (UUID)","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Game deactivated successfully"},"400":{"description":"Invalid UUID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description"}}}}}}}}}}}
```
