Skip to main content

Chests

Chests are reward containers a player can own and open to receive randomized prizes. RapidMule rolls the prize pool on the server when a chest is opened, optionally scaling the reward by the player's level. These endpoints let you open a chest, list a player's chests, preview a chest's possible contents, and read a player's open history.

Open Chest​

Opens one chest the player owns and returns the prizes that were rolled and granted.

Endpoint​

POST /v1/chest/open

Request Body​

ParameterTypeRequiredDescription
playerIdstringYesUnique identifier for the player
chestDeliverableUIdstringYesUID of the chest deliverable to open

Example Request​

{
"playerId": "{{playerID}}",
"chestDeliverableUId": "{{chestID}}"
}

Response​

{
"code": 200,
"data": {
"chestLabel": "Loot Chest",
"scalingMode": "Custom",
"playerLevel": 5,
"drawCount": 1,
"prizes": [
{
"label": "Football Jersey",
"amount": 1.0000,
"imageName": "https://rapidmulestorage.blob.core.windows.net/images/d73830ad-d553-4871-bf3c-98839cd8c29e_jersey.png",
"type": 1
}
]
}
}

Response Fields​

FieldTypeDescription
chestLabelstringDisplay name of the opened chest
scalingModestringHow rewards scale: None, PlayerLevel, or Custom
playerLevelnumberThe player's level at the time of opening
drawCountnumberHow many prizes were drawn
prizesarrayThe prizes granted
prizes[].labelstringPrize deliverable name
prizes[].amountnumberAmount granted
prizes[].imageNamestringURL to the prize image
prizes[].typenumberDeliverable type of the prize

Request Example​

curl -X POST https://api.rapidmule.com/v1/chest/open \
-H "AuthKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"playerId": "{{playerID}}",
"chestDeliverableUId": "{{chestID}}"
}'

List Chests​

Returns the chests a player currently owns. When the player owns no chests, data is an empty array.

Endpoint​

POST /v1/chest/list

Request Body​

ParameterTypeRequiredDescription
playerIdstringYesUnique identifier for the player

Response​

{
"code": 200,
"data": [
{
"chestDeliverableUid": "5bab9d902c8e4316b9d9fa0ddd91863d",
"label": "Loot Chest",
"imageName": null,
"balance": 33.0000,
"scalingMode": "Custom",
"isActive": true
}
]
}

Response Fields​

FieldTypeDescription
chestDeliverableUidstringUID of the chest deliverable
labelstringDisplay name of the chest
imageNamestringURL to the chest image (may be null)
balancenumberHow many of this chest the player owns
scalingModestringReward scaling mode: None, PlayerLevel, or Custom
isActivebooleanWhether the chest is currently active

Request Example​

curl -X POST https://api.rapidmule.com/v1/chest/list \
-H "AuthKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"playerId": "{{playerID}}"}'

Preview Chest​

Returns a chest's possible contents with their drop weights — without opening it or requiring the player to own one. Points and powerup contents are excluded from previews.

Endpoint​

POST /v1/chest/preview

Request Body​

ParameterTypeRequiredDescription
chestDeliverableUIdstringYesUID of the chest deliverable to preview
playerIdstringNoOptional player context for level-scaled previews

Response​

{
"code": 200,
"data": {
"chestLabel": "Loot Chest",
"scalingMode": "Custom",
"drawCountMin": 1,
"drawCountMax": 1,
"contents": [
{
"rewardLabel": "Football Jersey",
"rewardImageName": "https://rapidmulestorage.blob.core.windows.net/images/d73830ad-d553-4871-bf3c-98839cd8c29e_jersey.png",
"type": 1,
"amountMin": 1.0000,
"amountMax": 1.0000,
"probability": 50,
"weightPct": 100.0,
"limited": false,
"remainingStock": -1
}
]

Response Fields​

FieldTypeDescription
chestLabelstringDisplay name of the chest
scalingModestringReward scaling mode: None, PlayerLevel, or Custom
drawCountMinnumberMinimum number of prizes drawn per open
drawCountMaxnumberMaximum number of prizes drawn per open
contentsarrayPossible rewards in the pool
contents[].rewardLabelstringReward deliverable name
contents[].rewardImageNamestringURL to the reward image
contents[].typenumberDeliverable type of the reward
contents[].amountMinnumberMinimum amount that can be awarded
contents[].amountMaxnumberMaximum amount that can be awarded
contents[].probabilitynumberRaw draw weight of this reward
contents[].weightPctnumberDraw weight as a percentage of the pool
contents[].limitedbooleanWhether the reward has limited stock
contents[].remainingStocknumberRemaining stock (-1 when unlimited)

Request Example​

curl -X POST https://api.rapidmule.com/v1/chest/preview \
-H "AuthKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chestDeliverableUId": "{{chestID}}", "playerId": "{{playerID}}"}'

Chest History​

Returns a player's chest-open history (most recent first). When there is no history, data is an empty array.

Endpoint​

POST /v1/chest/history

Request Body​

ParameterTypeRequiredDescription
playerIdstringYesUnique identifier for the player
topintegerNoMaximum number of records to return. Defaults to 100

Response​

{
"code": 200,
"data": [
{
"openedAt": 1783499458480,
"chestLabel": "Loot Chest",
"rewardLabel": "Points Booster",
"rewardImageName": null,
"type": 6,
"amount": 1.0000
},
{
"openedAt": 1783499458476,
"chestLabel": "Loot Chest",
"rewardLabel": "Football Jersey",
"rewardImageName": "https://rapidmulestorage.blob.core.windows.net/images/d73830ad-d553-4871-bf3c-98839cd8c29e_jersey.png",
"type": 1,
"amount": 1.0000
}
]

Response Fields​

FieldTypeDescription
openedAtlongUnix timestamp (ms) when the chest was opened
chestLabelstringName of the chest that was opened
rewardLabelstringName of the reward received
rewardImageNamestringURL to the reward image (may be null)
typenumberDeliverable type of the reward
amountnumberAmount of the reward received

Request Example​

curl -X POST https://api.rapidmule.com/v1/chest/history \
-H "AuthKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"playerId": "{{playerID}}", "top": 10}'

Use Cases​

  • Chest Opening UX: Drive an open-and-reveal animation from the open response
  • Odds Disclosure: Show drop rates with preview before a player spends
  • Inventory Display: List owned chests with list
  • Reward History: Show what a player has won over time with history

Error Codes​

CodeDescriptionResolution
1002Missing required fieldProvide playerId / chestDeliverableUId
4001Invalid AuthKeyVerify API key
9010Chest not found, inactive, or outside its active windowCheck the chest deliverable
9011Player does not own this chestThe player has no balance of this chest
9012Limited prize pool exhaustedNo stock remains in the chest pool
9013No reward tier for the player's levelConfigure a tier for the player's level
9020Player not foundVerify playerId exists
Related Endpoints