Skip to main content

Delete Action

This method reverses a previously processed action. When an action is deleted, RapidMule rolls back everything that action granted for the player: awarded points, badges (including ranked badge chains), achieved levels, and any prizes/deliverables. If the action charged a cost, that cost is refunded.

Use this when an upstream event needs to be undone — for example a cancelled purchase, a chargeback, or a correction of incorrectly submitted data.

Endpoint​

POST /v1/action/delete

Request Body​

ParameterTypeRequiredDescription
namestringYesThe name of the action to reverse. Must match the original action name
referenceIdstringYesThe unique reference id used when the original action was processed
playerIdstringYesUnique identifier for the player the action belongs to
multiplierdecimalNoThe multiplier used on the original action. Defaults to 1
timestamplongNoUnix timestamp in milliseconds. Defaults to current date time
detailsarrayNoContainer for Action Objects, matching the original action

Example Request​

{
"name": "purchase",
"referenceId": "order-f4a7c1b9-3e5d",
"playerId": "{{playerID}}",
"multiplier": 1
}

Response​

Success Response​

A successful reversal returns the standard envelope with code 200 and no data payload.

{
"code": 200
}

Request Example​

curl -X POST https://api.rapidmule.com/v1/action/delete \
-H "AuthKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "purchase",
"referenceId": "order-f4a7c1b9-3e5d",
"playerId": "{{playerID}}"
}'

Use Cases​

  • Cancelled Purchases: Roll back points and prizes when an order is refunded or voided
  • Chargebacks: Reverse rewards tied to a disputed transaction
  • Error Correction: Undo an action that was submitted with incorrect data

Error Codes​

CodeDescriptionResolution
1001Payload is nullCheck request body
1002Invalid PlayerVerify playerId exists
101Action is not reversibleThe action or its rewards cannot be rolled back
4001Invalid AuthKeyVerify API key
4002Missing tenant domainClient-tier keys must include a tenant domain
4003Auth tier not allowedUse a Server or Mobile key for this action
4004Nested actions not allowed for Client tierSend nested actions from a Server key
Irreversible Side Effects

Deleting an action permanently rolls back the points, badges, levels, and prizes it granted. Make sure the name, referenceId, and playerId exactly match the original request so the correct action is reversed.

Learn More

For details on how actions are processed in the first place, see Process Action and Core Concepts - Actions.