Skip to main content

Daily Reward Webhook

The daily_reward.get webhook resolves which items a player receives from a daily reward program. When a program is configured to be webhook-driven, Aghanim calls your server to ask which items to grant per day (and for the extra reward), and builds the player-facing reward based on your response in real time.

This webhook is triggered in the following cases:

  • A player opens the daily reward widget in the Game Hub.
  • A player claims a daily reward.

If your server does not respond, responds with a non-2xx status, times out, or returns a body that cannot be parsed, Aghanim silently falls back to the items configured statically for the program. This keeps daily rewards working even when your backend is temporarily unavailable.

Requirements

To use the daily_reward.get webhook from Aghanim, configure your webhook server as follows:

  • HTTPS endpoint, accepting POST webhook requests.
  • Listen for events generated and signed by Aghanim.
  • Respond with 2xx status codes and a JSON body describing the reward items.
  • Respond quickly — slow responses degrade the hub experience and trigger the static fallback.

Configuration

  1. Develop a function for the daily_reward.get webhook processing.
  2. Make your endpoint available.
  3. Register your endpoint within your Aghanim account → GameWebhooksAdd webhook by choosing the daily_reward.get event type.
  4. In the daily reward program settings, select the webhook so the program resolves its items through it.
  5. Place the daily reward widget on your Game Hub page so players can open it and trigger the webhook.

Alternatively, you can register your endpoint within Aghanim using the Create Webhook API method.

Trigger values

ValueDescription
hub.interactWhen the player opens the daily reward widget in the game hub.
hub.daily_reward_claimWhen the player claims a daily reward — to resolve the items to grant.
testWhen using the "Send test event" in the Dashboard.

See the full events and triggers matrix for how daily_reward.get relates to other event types.

Request schema

Below is an example of an daily_reward.get webhook request:

POST /your/webhook/uri HTTP/1.1
Content-Type: application/json
Host: your-webhook-endpoint.com
User-Agent: Aghanim/0.1.0
X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812
X-Aghanim-Signature-Timestamp: 1725548450

{
"event_type": "daily_reward.get",
"event_data": {
"player_id": "2D2R-OP3C",
"id": "dlrwd_eAeXgQGcaie",
"key": "season-1",
"is_anonymous": false
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": null,
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "hub.interact",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}

The Event schema

KeyTypeDescription
event_idstringUnique Event ID generated by Aghanim.
game_idstringYour game ID in the Aghanim system.
event_typestringThe type of the event, daily_reward.get in this case.
event_timenumberEvent date in Unix epoch time.
event_dataEventDataContains the event-specific data, with possible keys for inherited objects.
idempotency_keystring|nullEnsures webhook actions are executed only once, even if retried. Can be null depending on event type.
request_idstring|nullIf the event was triggered by an API request, the request ID is included.
sandboxbooleanIndicates whether the event was sent from the sandbox game environment.
triggerstring|nullThe trigger that caused the event to be sent.
transaction_idstringThe transaction ID generated by Aghanim. This ID may be the same for multiple events emitted within the same transaction.
contextEventContext|nullContextual information about the event.

The EventContext schema

KeyTypeDescription
orderOrderContext|nullOrder information associated with the event if applicable.
playerPlayerContext|null(Optional) Player information. To add this, enable "Add player context" in the webhook settings.

The EventData schema

KeyTypeDescription
player_idstringThe unique Player ID chosen for player authentication.
idstringUnique daily reward program ID generated by Aghanim.
keystring|nullGame-defined key of the daily reward program.
is_anonymousbooleanIndicates whether the current user is unauthenticated (anonymous).

Response schema

Return 200 OK with the following JSON payload. Both keys are optional — return only the days and extra reward you want to override; anything omitted falls back to the program's static configuration.

KeyTypeDescriptionRequired?
daysDailyRewardDay[]Items granted per reward day.No
extra_reward_itemsDailyRewardItem[]Items granted for the extra reward.No

The DailyRewardDay schema

KeyTypeDescriptionRequired?
day_numbernumberReward day the items belong to (≥ 1).Yes
itemsDailyRewardItem[]Items granted for the day (1–10 items).Yes

The DailyRewardItem schema

KeyTypeDescriptionRequired?
skustringSKU of the item granted for the reward. Must match a SKU in your catalog.Yes
quantitynumber|nullItem quantity. Falls back to the item's default when omitted.No
note

SKUs that do not match an item in the game's Aghanim catalog are silently ignored.

Example response

{
"days": [
{
"day_number": 1,
"items": [
{ "sku": "sword-001", "quantity": 1 },
{ "sku": "coins-pack", "quantity": 500 }
]
},
{
"day_number": 2,
"items": [
{ "sku": "shield-001" }
]
}
],
"extra_reward_items": [
{ "sku": "gem-pack", "quantity": 10 }
]
}

Need help? Contact our integration team at [email protected]

Need help?
Contact our integration team at [email protected]