> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Game events

> JSON Schemas for the five events Lobyco publishes when a game definition is created, updated, published, stopped or deleted.

Lobyco publishes a game event when a game definition changes. These events describe the game itself, not a customer, so they carry no `CustomerId`.

<Warning>
  The game id is `ActivityId` in these payloads, sent as a string. [Game attempt events](/integration/external-integrations/events/game-attempt-events) carry the same id as `GameId`, an integer.
</Warning>

## Field reference

| Event | Raised when |
| - | - |
| Game Created | A game is created |
| Game Updated | A game's settings change |
| Game Published | A game is published |
| Game Stopped | A game is stopped |
| Game Deleted | A game is deleted |

Game Created and Game Updated carry the game's settings. The other three carry only who made the change and when.

## Schemas

<Tabs>
  <Tab title="Game Created">
    ```json theme={"system"}
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "$defs": {
        "Reward": {
          "type": "object",
          "properties": {
            "Id": { "type": ["string", "null"] },
            "ExternalId": { "type": ["string", "null"] },
            "TotalCoupons": { "type": ["integer", "null"] }
          }
        },
        "CustomReward": {
          "type": "object",
          "properties": {
            "Id": { "type": ["string", "null"] },
            "Title": { "type": ["string", "null"] },
            "TotalRewards": { "type": "integer" },
            "BonusAmount": { "type": ["number", "null"] }
          }
        }
      },
      "properties": {
        "EventId": { "type": "string" },
        "ActivityId": { "type": "string" },
        "UnifiedCampaignId": { "type": ["string", "null"] },
        "CreatedAt": { "type": "string", "format": "date-time" },
        "Name": { "type": ["string", "null"] },
        "Url": { "type": ["string", "null"], "format": "uri" },
        "StartDate": { "type": "string", "format": "date-time" },
        "EndDate": { "type": "string", "format": "date-time" },
        "Rewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/Reward" } },
        "CustomRewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/CustomReward" } },
        "BonusRewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/CustomReward" } },
        "Priority": { "type": ["integer", "null"] },
        "MaxAllowedAttemptsPerDay": { "type": ["integer", "null"] },
        "MaxAllowedAttempts": { "type": ["integer", "null"] },
        "MaxAllowedWins": { "type": ["integer", "null"] },
        "WinRate": { "type": ["integer", "null"] },
        "DaysForPickup": { "type": ["integer", "null"] },
        "PickUpEndDate": { "type": ["string", "null"], "format": "date-time" },
        "SegmentationType": { "type": "string", "enum": ["Unsegmented", "Segmented", "Triggered"] },
        "AudienceIds": { "type": ["array", "null"], "items": { "type": "string" } },
        "IsSilentStopped": { "type": ["boolean", "null"] },
        "Author": { "type": ["string", "null"] },
        "WinAlgorithmType": { "type": "string", "enum": ["QueueBased", "TimeBased"] },
        "AmountOfPrizes": { "type": ["integer", "null"] },
        "TimeUnit": { "type": ["string", "null"], "enum": ["None", "Day", "Week", "Month", "Year", null] },
        "TimeUnitBetweenGameAttemptsIssued": { "type": ["integer", "null"] },
        "ValidForDays": { "type": ["integer", "null"] },
        "DrawType": { "type": "string", "enum": ["Instant", "Lottery"] }
      }
    }
    ```
  </Tab>

  <Tab title="Game Updated">
    ```json theme={"system"}
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "$defs": {
        "Reward": {
          "type": "object",
          "properties": {
            "Id": { "type": ["string", "null"] },
            "ExternalId": { "type": ["string", "null"] },
            "TotalCoupons": { "type": ["integer", "null"] }
          }
        },
        "CustomReward": {
          "type": "object",
          "properties": {
            "Id": { "type": ["string", "null"] },
            "Title": { "type": ["string", "null"] },
            "TotalRewards": { "type": "integer" },
            "BonusAmount": { "type": ["number", "null"] }
          }
        }
      },
      "properties": {
        "EventId": { "type": "string" },
        "ActivityId": { "type": "string" },
        "UnifiedCampaignId": { "type": ["string", "null"] },
        "Name": { "type": ["string", "null"] },
        "Url": { "type": ["string", "null"], "format": "uri" },
        "StartDate": { "type": "string", "format": "date-time" },
        "EndDate": { "type": "string", "format": "date-time" },
        "Rewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/Reward" } },
        "CustomRewards": { "type": ["array", "null"], "items": { "$ref": "#/$defs/CustomReward" } },
        "Priority": { "type": ["integer", "null"] },
        "MaxAllowedAttemptsPerDay": { "type": ["integer", "null"] },
        "MaxAllowedAttempts": { "type": ["integer", "null"] },
        "MaxAllowedWins": { "type": ["integer", "null"] },
        "WinRate": { "type": ["integer", "null"] },
        "DaysForPickup": { "type": ["integer", "null"] },
        "PickUpEndDate": { "type": ["string", "null"], "format": "date-time" },
        "SegmentationType": { "type": "string", "enum": ["Unsegmented", "Segmented", "Triggered"] },
        "AudienceIds": { "type": ["array", "null"], "items": { "type": "string" } },
        "IsSilentStopped": { "type": ["boolean", "null"] },
        "WinAlgorithmType": { "type": "string", "enum": ["QueueBased", "TimeBased"] },
        "AmountOfPrizes": { "type": ["integer", "null"] },
        "TimeUnit": { "type": ["string", "null"], "enum": ["None", "Day", "Week", "Month", "Year", null] },
        "TimeUnitBetweenGameAttemptsIssued": { "type": ["integer", "null"] },
        "ValidForDays": { "type": ["integer", "null"] },
        "DrawType": { "type": "string", "enum": ["Instant", "Lottery"] },
        "ModifiedDate": { "type": "string", "format": "date-time" },
        "ModifiedBy": { "type": ["string", "null"] }
      }
    }
    ```
  </Tab>

  <Tab title="Game Published">
    ```json theme={"system"}
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "EventId": { "type": "string" },
        "ActivityId": { "type": "string" },
        "UnifiedCampaignId": { "type": ["string", "null"] },
        "PublishedBy": { "type": ["string", "null"] },
        "PublishedAt": { "type": "string", "format": "date-time" }
      }
    }
    ```
  </Tab>

  <Tab title="Game Stopped">
    ```json theme={"system"}
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "EventId": { "type": "string" },
        "ActivityId": { "type": "string" },
        "UnifiedCampaignId": { "type": ["string", "null"] },
        "StoppedBy": { "type": ["string", "null"] },
        "StoppedAt": { "type": "string", "format": "date-time" }
      }
    }
    ```
  </Tab>

  <Tab title="Game Deleted">
    ```json theme={"system"}
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "EventId": { "type": "string" },
        "ActivityId": { "type": "string" },
        "UnifiedCampaignId": { "type": ["string", "null"] },
        "DeletedBy": { "type": ["string", "null"] },
        "DeletedAt": { "type": "string", "format": "date-time" }
      }
    }
    ```
  </Tab>
</Tabs>

## API reference

Endpoint documentation: [Games](/api-reference/promotion-platform/games).

## Related

* [Game attempt events](/integration/external-integrations/events/game-attempt-events) — a customer's attempts at the game.
* [Campaign events](/integration/external-integrations/events/campaign-events) — the campaigns that hold games.
* [OutboundAPI connection](/integration/external-integrations/outboundapi-connection) — how these events reach an endpoint in your system.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.