Aggregation API
Manage your operators from one backend integration: register an operator, list your accounts, and change each operator’s RTP, bet limits, theme and maximum exposure. Your credential can access only the operators assigned to your aggregator.
Players still use the same session and iframe integration. The aggregation API manages operator accounts; each operator keeps its own wallet endpoints and webhook secret.
Before you start
Ask Maktub for your aggregation credential and API address. Existing operators can be assigned to your aggregator by Maktub; you do not need to recreate them.
Examples use https://server.maktub.bet. Use the address confirmed for your
environment. Keep the aggregation credential on your backend, outside browser
code, launch URLs and logs. Send it on every aggregation request:
Authorization: Bearer YOUR_AGGREGATION_CREDENTIAL
Content-Type: application/json| Credential | Use it for |
|---|---|
| Aggregation credential | Registering operators and reading or updating their configuration. |
| Operator webhook secret | Authenticating wallet calls and creating that operator’s player sessions. |
| Player token | Opening the game for one player; returned by POST /session. |
All amounts in this API are USD, regardless of a player’s currency. Wallet webhooks continue to use the session currency.
1. Register an operator
POST /aggregation/operatorsSet MAKTUB_API_URL and MAKTUB_AGGREGATION_TOKEN in your backend environment:
curl --request POST "$MAKTUB_API_URL/aggregation/operators" \
--header "Authorization: Bearer $MAKTUB_AGGREGATION_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"externalOperatorId": "casino-42",
"websiteUrl": "https://casino.example/",
"webhookUrl": "https://wallet.example/main",
"webhookRetryUrl": "https://wallet.example/retry"
}'| Field | Required | Meaning |
|---|---|---|
externalOperatorId | Yes | Your stable operator reference. 1–64 letters, digits, underscores or hyphens; unique within your aggregator. |
websiteUrl | No | The operator’s public website, using HTTP or HTTPS. Informational only; omit it, or send null, when you keep no public URL, and responses return null. |
webhookUrl | Yes | The operator’s public HTTPS wallet endpoint. |
webhookRetryUrl | Yes | A different public HTTPS endpoint for wallet retries. Both endpoints share the same wallet ledger. |
configuration | No | Initial games, theme and maxExposure, following the update rules below. |
Wallet URLs must not contain credentials or fragments. Local and private addresses are not accepted. Implement the wallet webhook contract on both endpoints before opening player sessions.
Success returns HTTP 201 with created: true, the generated clientId,
a generated webhookSecret, and the operator configuration.
The operator is active immediately with system defaults. Without initial
configuration, the exposure cap is unset and each game uses its default settings.
Registration does not test your wallet or create a player session.
Store the returned clientId and webhookSecret securely, associated with your
externalOperatorId. Use those values in the session request.
Use clientId, rather than externalOperatorId or operatorId, in the URLs below.
Retry a registration safely
If the connection fails before you receive a response, resend the same body
with the same externalOperatorId. An identical retry returns HTTP 200,
created: false, and the same operator, including after concurrent requests.
A changed registration body under that reference returns HTTP 409; use PATCH for
later configuration changes.
A retry can recover the original webhook secret after a lost response. If Maktub
has changed that operator’s wallet secret or endpoints, it returns
webhookSecret: null and credentialChanged: true; contact Maktub for the current
wallet setup. GET and PATCH never return wallet secrets.
The response’s isStaging reflects the environment where the operator was
registered. You cannot change it through this API. Use the agreed environment
for production onboarding; if test and production share an operator registry,
use separate external references for those registrations.
2. List and read operators
GET /aggregation/operators
GET /aggregation/operators/:clientIdcurl "$MAKTUB_API_URL/aggregation/operators" \
--header "Authorization: Bearer $MAKTUB_AGGREGATION_TOKEN"The list response contains all your authorized operators:
{
"aggregatorId": "your-aggregator-id",
"operators": [
{
"operatorId": "maktub-operator-id",
"clientId": "returned-client-id",
"externalOperatorId": "casino-42",
"websiteUrl": "https://casino.example/",
"suspended": false,
"isStaging": false
}
]
}For an existing operator linked by Maktub, externalOperatorId may be null.
Call GET with the returned clientId to read its full configuration. An operator
outside your account and an unknown operator both return HTTP 404. Moving an
operator to another aggregator removes it from your access.
3. Update configuration
PATCH /aggregation/operators/:clientIdThis backend example changes Dice and the operator’s account theme, then reads the effective limit from the response:
const path = "/aggregation/operators/" + encodeURIComponent(clientId);
const response = await fetch(
process.env.MAKTUB_API_URL + path,
{
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.MAKTUB_AGGREGATION_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
maxExposure: 1000,
games: [
{ game: "dice", rtpPercent: 97, minBet: 0.1, maxBet: 100 },
],
theme: { buttonColor: "#22C993", darkBackground: "#101A18" },
}),
},
);
const result = await response.json();
if (!response.ok) {
const message = result.error ?? result.message;
throw new Error(message ?? `Configuration failed (${response.status})`);
}
const dice = result.games.find((game) => game.game === "dice");
// dice.configuredMaxBet is 100; dice.maxBet is 1 after exposure is applied.HTTP 200 returns the updated configuration. Omitted games and fields keep their previous values. An invalid field rejects the entire request before saving.
| Field | Rule |
|---|---|
games[].game | A casino event key from the game catalog, such as coin or dice. Futures is outside this configuration API. |
games[].rtpPercent | Only when the game’s rtp.configurable is true. Send 97 for 97%, not 0.97. rtp.rtpPresets tells the two kinds apart. When the entry lists it (paytable games such as keno, plinko, roulette, launch or pulse), send one of those whole-number presets, 90, 91, … 99; any other value, such as 97.5, returns 400. When it is absent (edge games such as dice or limbo), send any value from rtp.minPercent to rtp.maxPercent, 90 to 99 inclusive. Do not test for minPercent/maxPercent: paytable games list them too, as the return range of their table. Send null to return any configurable game to its default. The backoffice offers the same choices for every game as whole-number presets only; an edge-game value set here that is not a whole number, such as 97.5, appears there as custom and is kept until the operator picks another. |
games[].minBet, games[].maxBet | Send both when changing bet limits. Finite, nonnegative USD amounts, minimum ≤ maximum, at most ten decimal places. |
maxExposure | A positive USD amount with at most ten decimal places, or null to remove the cap. See below. |
theme | Account defaults using the appearance theme fields. Invalid values return 400. |
A paytable preset selects a generated paytable whose exact return lies between
the preset and 0.05 percentage points above it (preset 96 returns 96.00% to
96.05%). Keno’s Bonus Mode keeps its discount against regular play, so it
returns less than the preset: rtp.lightning states its range (83.95% to
88.81% at preset 90, 92.38% to 97.68% at 99). Each table keeps the default
table’s top prize, except where a bet has a single paying outcome and the return
can only rise through it: the roulette straight at 98% and 99%, the baccarat
tie at every preset, Double’s green from 94%, and keno high risk with 2 or 3
picks at 99% (17.16× and 81.51× instead of 17.1× and 81.5×). Blackjack and video
poker are fixed: their RTP cannot be overridden, and any rtpPercent for them,
null included, returns 400. Fixed RTP games can still have bet limits changed.
Setting a game’s bet limits to 0 and 1000000 restores the platform defaults,
including their currency-aware ceiling.
Use null to clear the whole theme, a theme field, or an individual component
field. For example, {"theme":{"buttonColor":null}} restores the default button
color while keeping other account settings. Session appearance values take
precedence over account defaults. To see an account-theme change, launch a new
session without overriding that field.
Configuration response
POST registration, GET of one operator and PATCH include these fields:
| Field | Meaning |
|---|---|
clientId, operatorId, aggregatorId, externalOperatorId, websiteUrl | Account identifiers and website, as in the list response. |
suspended, isStaging | Current operator status and test-environment marker. |
currency | Always USD for these configuration amounts. |
revision | Configuration version for reference; PATCH does not take a revision precondition. Avoid overlapping updates to the same fields. |
maxExposure | The gross payout cap, or null when unset. |
theme | The operator’s configured theme defaults. |
games | All 31 casino game configurations, even before an operator has any wagers. |
Each games entry contains game, enabled, minBet, maxBet,
configuredMinBet, configuredMaxBet and rtp. Use minBet/maxBet as the
effective limits; the configured values are the saved limits before exposure.
For an edge game, rtp includes configurable: true, configuredRtpPercent
(the RTP in force), and minPercent and maxPercent, the range rtpPercent
accepts. For a paytable game, rtp includes configurable: true, rtpPresets
(the values rtpPercent accepts), rtpPreset when one is set, and the exact
return of the table in force, the preset’s or the default one: a percentage, a
range across risks and rows (minPercent/maxPercent, here a return rather
than an accepted input), or per-bet variants. Keno adds lightning, the
minPercent/maxPercent range of its Bonus Mode. Until a preset is set, Launch
and Pulse also carry configuredRtpPercent and certifiedRtpPercent for their
default curve. Fixed games return configurable: false and their percentage,
range or per-bet variants. An undeclared RTP is unavailable, not 0%. Paytable
games report configurable: true and rtpPresets even with no preset set; before
2026-10-06 they reported configurable: false, so ignore keys you do not
recognize rather than rejecting the response.
Maximum exposure
maxExposure limits the total payout of one casino round, including the
returned stake. For example, a $100 payout on a $10 stake consumes $100 of
exposure, not $90. It is not a daily limit or a shared pool across players.
Futures is excluded.
The effective maximum stake is the smaller of your configured maximum and
maxExposure / maximum return. Exposure allocation uses the fixed 1,000×
maximum-multiplier contract, or a lower return bound for games that pay less.
For example, $500,000 exposure allows a maximum $500 stake in Limbo; a configured
$100 maximum still stays $100. Plinko and Wire take a per-ball amount, so their
allocation includes all 15 possible balls: the same budget allows up to
$33.3333333333 per ball. Side bets and bonuses remain part of the round budget.
The minimum is reduced only when it exceeds the effective maximum. Configured
limits remain saved; raising or removing exposure restores the room they allow.
Very small caps can leave no positive stake at the supported precision.
- RTP presets: a preset that pays more on a single outcome than the default
table (a roulette straight at 98% or 99%, the baccarat tie at any preset,
Double’s green from 94%) has a higher maximum return, so the same exposure
allows a smaller stake.
minBet/maxBetin the response already reflect it. - Hilo: a next step is refused if a winning step could exceed the round’s cap. The player can still cash out the amount already earned.
- Crash: Maktub supplies an automatic cashout no higher than the cap divided by the stake, rounded down to the supported multiplier precision. An earlier player-selected target remains earlier.
Send {"maxExposure":null} to remove the cap. Zero is invalid. Externally settled
parimutuel operators cannot enable this setting.
When changes take effect
Bet limits and exposure can take up to 60 seconds to reach gameplay. Realtime connections refresh their limits before accepting a new placement. Lowering exposure never truncates a payout already earned under the previous limit.
RTP retains each game’s existing behavior. Some multistep games read current RTP again at cashout. Crash and Slide retain their engine’s RTP until the engine is recreated, currently through a worker restart. Saving RTP through this API does not trigger that restart; coordinate it with Maktub when changing those games.
Errors and recovery
Aggregation errors return {"error":"description"}. Infrastructure-level
responses can use message instead. Check the HTTP status first.
| Status | Next action |
|---|---|
400 | Correct the fields, RTP range, bet limits or URLs. Unknown fields and changes to fixed RTP are rejected. |
401 | Check the aggregation credential and environment. Ask Maktub whether it was renewed or revoked. |
404 | Check clientId and current operator assignment. |
409 | Reuse the original registration body or PATCH the existing operator; do not invent a new external reference for a retry. |
429 | Slow requests and retry with backoff. |
503 or a lost connection | Retry registration with its original identity/body. For PATCH, read the current configuration before retrying if another editor may have changed it. |
Maktub manages aggregation credentials. Renewal invalidates the old credential; revocation removes API access. Neither changes the operators’ wallet secrets.
Before going live, register a test operator, verify that list/read return only your accounts, update and read back its configuration, then follow the wallet and gameplay checks using a disposable player. A successful registration is not evidence that the wallet integration has passed.