## Add New Game to List of Games in Campaign

This endpoint allows you to add a new game to a campaign.

A game cannot be added if any of the following conditions are met:

* the campaign is ended or disabled
* the game has already been added to the campaign


**API Call Sample:**

```shell curl
curl -i -X POST \
  -u '<username>:<password>' \
  https://asia.stage.rubyplay.io/api/v1/campaign/123/game \
  -H 'Content-Type: application/json' \
  -d '{
    "gameId": "rp_140"
  }'
```

```json 201 application/json
{
  "gameId": "rp_140"
}
```

```json 401 application/json
{
  "code": "NOT_AUTHORIZED",
  "message": "Authentication failed",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign/{campaignId}/game"
}
```

```json 403 application/json
{
  "code": "INSUFFICIENT_SCOPE",
  "message": "Insufficient scope to access this resource. Required: campaign:post",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign/{campaignId}/game"
}
```

```json 500 application/json
{
  "code": "UNKNOWN_ERROR",
  "message": "Something went wrong",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign/{campaignId}/game"
}
```

```json 504 application/json
{
  "code": "TIMEOUT",
  "message": "The server did not respond within the expected time",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign/{campaignId}/game"
}
```

**Request Schema:**

```json
{
  "$ref": "#/components/schemas/UpdateGameRequest",
  "components": {
    "schemas": {
      "UpdateGameRequest": {
        "type": "object",
        "properties": {
          "gameId": {
            "type": "string",
            "description": "Game ID.",
            "example": "rp_140",
            "minLength": 1
          }
        },
        "required": [
          "gameId"
        ]
      }
    }
  }
}
```

**Response Schema:**

```json
{
  "$ref": "#/components/schemas/GameDto",
  "components": {
    "schemas": {
      "GameDto": {
        "type": "object",
        "properties": {
          "gameId": {
            "type": "string",
            "description": "Unique identifier of the game in RubyPlay's system",
            "example": "rp_140"
          }
        }
      }
    }
  }
}
```