Games You Play Webhooks

Overview

Games You Play (GYP) webhooks deliver real-time notifications for recreational game events. All GYP webhooks follow the verification process described in Webhook Setup.

Prerequisites

  • Webhook endpoint configured per Webhook Setup

  • Subscribed to relevant GYP event types

  • Signature verification implemented

Event Types

Event
Trigger

RecreationalGameCreated

New recreational game created

RecreationalGameJoined

User joins a game

RecreationalGameCanceled

Game canceled

RecreationalGameCompleted

Game completed with outcome

RecreationalGameStarted

Game started by owner

Payload Structure

All GYP webhook events share a common payload structure:

Payload Fields

Root Level

  • event (string) - Event type identifier

  • matchup (object) - Game details

Matchup Object

  • id (string) - UUID of the matchup

  • createdByUserId (string) - UUID of user who created the game

  • gameId (string) - External game identifier

  • winnerGroupId (string|null) - UUID of winning group (null until completed)

  • status (string) - Current game status (see statuses below)

  • type (string) - Always RECREATIONAL_GAME for GYP

  • subtype (string) - Game format: GROUP_VS_GROUP or FREE_FOR_ALL

  • buyInAmount (number) - Entry cost per player

  • isPublic (boolean) - Whether game is publicly joinable

  • groups (array) - Participating groups/teams

Group Object

  • groupId (string) - UUID of the group

  • name (string) - Group/team name

  • users (array) - Players in this group

User Object

  • userId (string) - UUID of the user

  • userMetadata (string) - Custom user metadata

  • reward (object|null) - Reward information (populated on completion)

Reward Object

  • type (string) - Reward type: CASH or TENANT_REWARD

  • value (string) - Reward amount or value

  • metadata (object) - Additional reward information

Game Statuses

  • OPEN - Game created, accepting players

  • CONFIRMED - Minimum players joined

  • LOCKED - No more players can join

  • PENDING_OUTCOMES - Awaiting results

  • CLOSED - Completed with winner

  • CLOSED_TIE - Completed in tie

  • CANCELED_BY_OWNER - Canceled by creator

  • CANCELED_NOT_ACCEPTED - Canceled due to insufficient players

  • CANCELED_THROUGH_API - Canceled via API

  • CANCELED_TIMEOUT - Canceled due to timeout

Event Details

RecreationalGameCreated

Triggered when a new recreational game is created.

Typical Status: OPEN

Use Cases:

  • Notify players of new game availability

  • Track game creation metrics

  • Update external systems

Example:

RecreationalGameJoined

Triggered when a user joins an existing game.

Typical Status: OPEN or CONFIRMED

Use Cases:

  • Notify other players of new participant

  • Update participant counts

  • Trigger game confirmation logic

RecreationalGameStarted

Triggered when the game owner starts the game.

Typical Status: LOCKED or PENDING_OUTCOMES

Use Cases:

  • Lock game roster

  • Begin tracking game progress

  • Notify participants game has begun

RecreationalGameCompleted

Triggered when game outcome is determined.

Typical Status: CLOSED or CLOSED_TIE

Use Cases:

  • Distribute winnings

  • Update player statistics

  • Trigger reward fulfillment

Example:

RecreationalGameCanceled

Triggered when a game is canceled.

Typical Status: CANCELED_* (various cancellation reasons)

Use Cases:

  • Process refunds

  • Notify participants

  • Update game listings

Webhook Handling Best Practices

Idempotency

Webhooks may be delivered multiple times. Implement idempotent handling using the matchup id:

Status Transitions

Track expected status transitions to detect anomalies:

Error Handling

Return 2xx status codes for successful processing. Lucra will retry failed webhook deliveries:

Last updated