THE BIG PICTURE
Three parts work together
The casino remains the source of player and game activity. It sends events to Competition Engine over HTTPS. The engine processes them in the background, while the casino can read the latest leaderboard and receive configured notifications.
Keep the API key on casino servers. A browser should call the casino backend, not Competition Engine directly.
IMPLEMENTATION PLAN
Integrate in a few clear steps
- Set up an environment. An administrator creates the operator environment and provides its API key.
- Agree on event data. Choose action names, customer IDs, timestamps and the values your competition rules will evaluate.
- Send events. The casino backend sends each event to the HTTPS API. The casino does not connect to RabbitMQ.
- Read standings. The casino website backend requests leaderboard data and presents it in the casino’s own frontend.
- Connect notifications. Configure webhook URLs if the casino needs to react to competition or reward changes.
Player IDs must be consistent across event submissions, customer sync and participant registration. They are the link between casino activity and a player’s competition results.
1 · CASINO → ENGINE
Send events with an HTTP POST
The casino sends a JSON request to the environment’s event endpoint. The API acknowledges receipt first; scoring happens asynchronously after the event is handed to the engine’s internal processing queue.
https://gamification-demo.com/api/env/{env_name}/events
For example, the demo environment is casino_demo.
Replace the host and environment name with the values supplied for
your integration.
Authentication and headers
Send the environment API key in the X-API-KEY header
and mark the request as JSON. Use HTTPS and keep the key in
server-side configuration.
Content-Type: application/json
X-API-KEY: <environment-api-key>
Event body
Every event uses the same outer shape. The metadata object contains casino-specific details.
event_uuidUnique ID for this event in the environment. Keep it unchanged when retrying the same event.actionEvent kind used by the competition rules, for example casino_wager.sourceValueNumeric source value used by the configured event evaluation.memberRefIdThe casino’s external customer/player ID.transactionTimestampWhen the activity happened, in ISO 8601 date-time format.metadataOptional JSON object with the game, transaction, currency and other event attributes.Example: casino wager
{
"event_uuid": "08c29c8f-8ca1-4d86-b3c0-9140dc134518",
"action": "casino_wager",
"sourceValue": 0.128,
"memberRefId": 168468,
"transactionTimestamp": "2026-11-26T11:33:05.135+00:00",
"metadata": {
"gameId": "1599738017",
"gameName": "Big Bass Bonanza",
"roundId": "117624145946131",
"currency": "CAD",
"realMoneyAmount": 0.2,
"baseCurrencyRealMoneyAmount": 0.128,
"bonusAmount": 0.0,
"vendorName": "Pragmatic"
}
}
Action names and metadata keys are integration data: agree on them
with the team configuring the competition rules. Example event
kinds include casino_wager, casino_win,
registration and deposit.
Send the example with curl
curl --request POST \
--url "https://gamification-demo.com/api/env/casino_demo/events" \
--header "Content-Type: application/json" \
--header "X-API-KEY: $COMPETITION_ENGINE_API_KEY" \
--data-binary @event.json
What does the response mean?
A successful event submission returns 202 Accepted.
This means the engine accepted the event for processing—not that
the leaderboard has already changed. Use the event UUID for
correlation and check the leaderboard API after processing.
{"status":"success","message":"Event accepted for processing","data":{}}
Send one unique event_uuid per real event. Reuse that
ID for retries of the same event to avoid counting the same activity
twice.
OPTIONAL SETUP APIs
Other useful endpoints
All of these use the same environment path and X-API-KEY authentication.
| Purpose | Method and path | When to use it |
|---|---|---|
| Upsert a customer | POST/customers/upsert |
Sync a player ID and display name. Events can create a customer automatically, but an upsert supplies the name. |
| Sync labels | PUT/labels/sync |
Maintain the environment’s label definitions. |
| Assign customer labels | PUT/customer_labels/sync |
Set the labels associated with a customer. |
| Opt a customer into a competition | POST/competitions/{competition_id}/participants |
Use when players must explicitly join. The customer must already exist in the environment. |
These paths follow
/api/env/{env_name}. For example,
/api/env/casino_demo/customers/upsert.
3 · ENGINE → CASINO
Use webhooks for notifications
A webhook is an HTTP request that Competition Engine sends to a URL owned by the casino. It is useful when the casino needs to react to changes without repeatedly checking for them.
An administrator configures a callback URL and chooses
POST or PATCH for each notification type
in the environment’s Webhooks settings.
| Notification key | Typical use |
|---|---|
competition_creation | Receive a competition definition when it is created. |
competition_start | React when a competition starts. |
competition_update | Refresh casino-side competition information after an update. |
contest_creation | Receive a contest/stage definition when it is created. |
contest_update | Refresh contest/stage information after an update. |
issue_competition_reward | Fulfil or record a competition reward. |
issue_achievement_reward | Fulfil or record an achievement reward. |
The request is JSON and includes the environment’s
X-API-KEY header. The body uses a standard
status, message and data
envelope; the contents of data depend on the
notification. Reward webhooks may also require the corresponding
reward feature to be enabled.
{
"status": "success",
"message": "Competition started",
"data": {
"id": 2,
"name": "Weekend Race",
"start_date": "2026-11-26T12:00:00Z",
"end_date": "2026-11-27T12:00:00Z"
}
}
Use an HTTPS callback URL, verify the API key, and make the receiver safe to call more than once. Reward delivery is separate from scoring: the casino remains responsible for its own prize fulfilment unless a specific reward integration is agreed.
2 · CASINO WEBSITE → ENGINE
Build the player leaderboard
The casino website’s backend can request the latest standings and render them in the casino’s own design. The response includes both participant results and the competition’s configured rewards.
https://gamification-demo.com/api/env/{env_name}/competitions/{competition_id}/leaderboard
Optional query parameters: limit controls how many
ranked players are returned (the default is 10), and
customer_id is the casino’s external player ID. For
threshold-reach competitions, provide customer_id to
retrieve that player’s result.
GET /api/env/casino_demo/competitions/2/leaderboard?limit=20
X-API-KEY: <environment-api-key>
The response is wrapped in data and includes:
kindandscoring_strategy— how the competition is organized and scored.rewards— configured reward values and evaluation rules.contests— contest dates, threshold (when applicable) and participant standings.participants— player IDs, display names, scores and (for ranked leaderboards) positions.
{
"status": "success",
"data": {
"kind": "single_stage",
"scoring_strategy": "max_points",
"rewards": [
{
"value": 100.0,
"kind": "real_money",
"evaluation_value": 1,
"evaluation_strategy": "position"
}
],
"contests": [
{
"id": 2,
"name": "Weekend Race",
"start_date": "2026-11-26T12:00:00Z",
"end_date": "2026-11-27T12:00:00Z",
"threshold": null,
"participants": [
{
"contest_id": 2,
"customer_external_id": 168468,
"customer_name": "Player 168468",
"customer_score": "42.0",
"customer_position": 1
}
]
}
]
}
}
The rewards list describes configured prizes; it is
not a payment instruction or proof that a player has been paid.
Use reward notifications and your casino’s fulfilment process for
actual prize handling.
BEFORE GOING LIVE
Security and reliability checklist
- Use HTTPS for event requests and webhook callback URLs.
- Keep
X-API-KEYin trusted server-side configuration; never put it in browser JavaScript. - Use the environment-specific API key and environment name supplied by the operator.
- Generate a unique event UUID and preserve it when retrying the same event.
- Send the original event time in
transactionTimestamp, not the delivery time. - Treat
202 Acceptedas queued for processing, not as confirmation of a new leaderboard position. - Test with non-production player IDs and verify action names and evaluation rules before launch.