API Reference
Build game backend features in minutes. Our APIs are designed for indie developers who want surgical-grade infrastructure without the complexity.
1 Authentication
All API requests require a valid API key from your DYMOL Dashboard. Pass it in the Authorization header.
Authorization: Bearer dymol_sk_... 2 Base URL
All endpoints are relative to this base URL. Replace YOUR_PROJECT with your project slug.
https://api.dymol.dev/v1 3 Error Handling
Missing or invalid API key
Key not bound to a project
Missing required fields
Resource doesn't exist
{
"error": "Unauthorized: Invalid API Key"
} ReactionAPI
Sentiment-as-a-Service
Quick Start
using UnityEngine;
using UnityEngine.Networking;
using System.Text;
using System.Collections;
public class DymolReactions : MonoBehaviour {
private string apiKey = "YOUR_API_KEY";
public IEnumerator AddReaction(string targetId, string type, string userId) {
string url = "https://api.dymol.dev/v1/react";
string json = $"{{\"target_id\":\"{targetId}\",\"type\":\"{type}\",\"user_id\":\"{userId}\"}}";
using (UnityWebRequest www = new UnityWebRequest(url, "POST")) {
byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
www.uploadHandler = new UploadHandlerRaw(bodyRaw);
www.downloadHandler = new DownloadHandlerBuffer();
www.SetRequestHeader("Content-Type", "application/json");
www.SetRequestHeader("Authorization", $"Bearer {apiKey}");
yield return www.SendWebRequest();
}
}
} POST /v1/react
Submit or update a reaction. Uses upsert — if the same user reacts again to the same target, their previous reaction is overwritten.
{
"target_id": "level_99",
"type": "fire",
"user_id": "player_123"
} The ID of the target (level, post, item)
Reaction type e.g. fire, like, heart
Unique player identifier
GET /v1/reactions
Get a global aggregation of all reactions, broken down by target_id.
{
"success": true,
"data": {
"total_reactions": 3,
"global_distribution": {
"fire": 2,
"heart": 1
},
"targets": {
"level_99": { "fire": 1 },
"junk_20": { "fire": 1, "heart": 1 }
}
}
} PromoCode API
Create limited promo codes for in-game rewards
Quick Start
using UnityEngine;
using UnityEngine.Networking;
using System.Text;
using System.Collections;
public class DymolPromoCodes : MonoBehaviour {
private string apiKey = "YOUR_API_KEY";
public IEnumerator RedeemPromoCode(string codeId, string userId) {
string url = "https://api.dymol.dev/v1/promo/redeem";
string json = $"{{\"code_id\":\"{codeId}\",\"user_id\":\"{userId}\"}}";
using (UnityWebRequest www = new UnityWebRequest(url, "POST")) {
byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
www.uploadHandler = new UploadHandlerRaw(bodyRaw);
www.downloadHandler = new DownloadHandlerBuffer();
www.SetRequestHeader("Content-Type", "application/json");
www.SetRequestHeader("Authorization", $"Bearer {apiKey}");
yield return www.SendWebRequest();
if (www.result == UnityWebRequest.Result.Success) {
string response = www.downloadHandler.text;
Debug.Log("Promo response: " + response);
} else {
Debug.LogError("Promo error: " + www.error);
}
}
}
} POST /v1/promo/redeem
Redeem a promo code for a specific user. Each user can only redeem a code once. The code is automatically deactivated when claims_count reaches max_claims. The request is scoped to the project associated with the API key.
{
"code_id": "SUMMER2025",
"user_id": "player_123"
} The promo code to redeem (case-insensitive)
Unique player identifier (prevents duplicate redemptions)
{
"status": "SUCCESS",
"message": "Promo code redeemed successfully",
"data": {
"code_id": "SUMMER2025",
"claims_count": 42,
"max_claims": 1000
}
} {
"status": "ALREADY_CLAIMED",
"error": "You have already redeemed this code"
} Status Codes
SUCCESS — Code redeemed, reward granted
ALREADY_CLAIMED — This user already redeemed this code
EXHAUSTED — Code reached max claims or was deactivated
INVALID — Code does not exist in this project
CounterAPI
Track any in-game event with automatic aggregation
Quick Start
using UnityEngine;
using UnityEngine.Networking;
using System.Text;
using System.Collections;
public class DymolCounters : MonoBehaviour {
private string apiKey = "YOUR_API_KEY";
public IEnumerator IncrementCounter(string targetId, string userId, int amount = 1) {
string url = "https://api.dymol.dev/v1/counter/increment";
string json = $"{{\"target_id\":\"{targetId}\",\"user_id\":\"{userId}\",\"amount\":{amount}}}";
using (UnityWebRequest www = new UnityWebRequest(url, "POST")) {
byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
www.uploadHandler = new UploadHandlerRaw(bodyRaw);
www.downloadHandler = new DownloadHandlerBuffer();
www.SetRequestHeader("Content-Type", "application/json");
www.SetRequestHeader("Authorization", $"Bearer {apiKey}");
yield return www.SendWebRequest();
if (www.result == UnityWebRequest.Result.Success) {
Debug.Log("Counter incremented!");
}
}
}
} POST /v1/counter/increment
Increment a counter for a specific target. Uses upsert — if the target doesn't exist, it's created automatically. Each increment is logged for analytics.
{
"target_id": "boss_dragon_defeated",
"user_id": "player_123",
"amount": 1
} The ID of the event to count (e.g. "blocks_broken", "level_started")
Unique player identifier (logged for analytics)
Amount to increment by (default 1, max 1,000,000)
{
"success": true,
"message": "Counter incremented successfully",
"data": {
"target_id": "boss_dragon_defeated",
"count": 1542
}
} GET /v1/counter
Get aggregated counters for all targets in your project, plus the global total.
{
"success": true,
"data": {
"total_counts": 15420,
"targets": {
"blocks_broken": 8400,
"boss_dragon_defeated": 1542,
"level_started": 5478
}
}
} GET /v1/counter/:target_id
Get the current count for a specific target.
{
"success": true,
"data": {
"target_id": "boss_dragon_defeated",
"count": 1542
}
} GET /v1/counter/daily
Get daily aggregated counter data for the last 7 days (or specify days query param). Optionally filter by target_id.
{
"success": true,
"data": [
{ "day": "2026-05-04", "count": 120 },
{ "day": "2026-05-05", "count": 245 },
{ "day": "2026-05-06", "count": 189 },
{ "day": "2026-05-07", "count": 312 },
{ "day": "2026-05-08", "count": 278 },
{ "day": "2026-05-09", "count": 401 },
{ "day": "2026-05-10", "count": 156 }
]
} DeathAPI
Track player death coordinates for heatmap analysis
Quick Start
using UnityEngine;
using UnityEngine.Networking;
using System.Text;
using System.Collections;
public class DymolDeaths : MonoBehaviour {
private string apiKey = "YOUR_API_KEY";
public IEnumerator RecordDeath(string levelId, Vector3 pos, string cause) {
string url = "https://api.dymol.dev/v1/deaths";
string json = $"{{\"level_id\":\"{levelId}\",\"x\":{pos.x},\"y\":{pos.y},\"z\":{pos.z},\"cause\":\"{cause}\"}}";
using (UnityWebRequest www = new UnityWebRequest(url, "POST")) {
byte[] bodyRaw = Encoding.UTF8.GetBytes(json);
www.uploadHandler = new UploadHandlerRaw(bodyRaw);
www.downloadHandler = new DownloadHandlerBuffer();
www.SetRequestHeader("Content-Type", "application/json");
www.SetRequestHeader("Authorization", $"Bearer {apiKey}");
yield return www.SendWebRequest();
}
}
} POST /v1/deaths
Record a player death with 3D coordinates. Use this from your game client every time a player dies.
{
"level_id": "level_1",
"x": 12.5,
"y": 3.2,
"z": -7.8,
"cause": "fall"
} The level or map where the death occurred
3D coordinates of the death location
Death cause (e.g. "fall", "enemy", "lava")
{
"success": true,
"message": "Death recorded successfully",
"data": { "id": 42 }
} GET /v1/deaths/:level_id
Retrieve death coordinates for a specific level. Returns up to 1000 records ordered by created_at DESC. Use this in the Unity Editor to generate a 3D heatmap.
{
"success": true,
"data": [
{
"x": 12.50,
"y": 3.20,
"z": -7.80,
"cause": "fall",
"created_at": "2026-05-17T10:32:00Z"
}
]
}