Skip to main content
SusaPlaySDK.Webhooks sends an event from your game to SusaPlay, which forwards it to every webhook endpoint you subscribed to CUSTOM_WEBHOOK_EVENT. Use it when your own server needs to know what happens in the game. Setting up the endpoint and verifying its signature is covered in Webhooks.

Send an event

SendEvent(eventName, value, parameters) returns immediately. value and parameters are optional; values can be strings, numbers, booleans, lists and dictionaries. To wait for the platform’s answer, use SendEventAsync, which returns an HttpResponse:
An empty event name is not sent.

What your server receives

A CUSTOM_WEBHOOK_EVENT delivery whose data holds the player, the session and your event:
For a player who arrived through a partner, partnerId is set and externalUserId carries the partner’s own id for that player.

Reserved event names

Two names do more than forward the event.

level_up

Reports the player’s level. The level must be a non-negative integer, sent as level in the parameters or as the value:
Without a valid level the event is refused with 400 INVALID_ARGUMENT.

achievement_unlocked

Unlocks a one-shot achievement for the player, exactly as Achievements.Unlock does, and then forwards the event:
Without an achievementId the event is refused with 400 INVALID_ARGUMENT; an id you have not registered gets 404 NOT_FOUND.