General Basketcase REST API
High-performance Monte Carlo battle simulation, multi-participant rally resolution, simplex troop ratio optimization, and parameter sensitivity analysis.
Kingshot Simulator is hosted directly as a root application at kssimbasket.duckdns.org with all API routes mounted directly under /api/v1.
maxBattleRounds, default 30). Hero widgets strictly adhere to authentic role-based activation (Attacker marches activate Rally widgets; Defender garrisons activate Defender widgets). Supports optional mixed-tier vanguard meat-shield stratification (attackerMeatShieldConfigs / defenderMeatShieldConfigs), Master configurations (attackerMasters / defenderMasters or player.masters for Cassia & Guinevere Swordland bonuses), and returns win rates, casualty distributions, per-side hero skill trigger & kill telemetry (attackerSkillTriggers / defenderSkillTriggers), and turn-by-turn combat replay telemetry.
import requests
url = "http://localhost:5000/api/v1/simulate/battle"
payload = {
"selectedScenario": 0, # 0 = PvP_SoloAttack
"iterations": 10000,
"maxBattleRounds": 30, # Default 30 (Official Game & Web Calc Parity)
"attackerPlayer": {
"name": "Attacker Army",
"squads": [
{ "type": 0, "tier": 10, "count": 150000, "modifiers": { "attack": 150.0, "lethality": 120.0 } },
{ "type": 1, "tier": 10, "count": 60000, "modifiers": { "attack": 150.0, "lethality": 120.0 } },
{ "type": 2, "tier": 10, "count": 90000, "modifiers": { "attack": 150.0, "lethality": 120.0 } }
]
},
"defenderPlayer": {
"name": "Defender Garrison",
"squads": [
{ "type": 0, "tier": 10, "count": 100000, "modifiers": { "defense": 140.0, "health": 110.0 } },
{ "type": 1, "tier": 10, "count": 100000, "modifiers": { "defense": 140.0, "health": 110.0 } },
{ "type": 2, "tier": 10, "count": 100000, "modifiers": { "defense": 140.0, "health": 110.0 } }
]
}
}
response = requests.post(url, json=payload)
data = response.json()
win_rate = (data["attackerWins"] / data["iterations"]) * 100.0
print(f"Attacker Win Rate: {win_rate:.2f}% | Avg Rounds: {data['averageRounds']:.1f}")
print(f"Avg Casualties - Attacker: {data['averageAttackerCasualties']:,.0f} | Defender: {data['averageDefenderCasualties']:,.0f}")
import requests
url = "http://localhost:5000/api/v1/simulate/rally"
payload = {
"selectedScenario": 1, # 1 = PvP_KingsCastle
"iterations": 5000,
"attackerRally": {
"captain": {
"name": "Rally Captain",
"squads": [{ "type": 0, "tier": 10, "count": 300000, "modifiers": { "attack": 250.0 } }]
},
"joiners": [
{ "name": "Joiner Alpha", "squads": [{ "type": 1, "tier": 10, "count": 150000 }] },
{ "name": "Joiner Beta", "squads": [{ "type": 2, "tier": 10, "count": 150000 }] }
]
},
"defenderGarrison": {
"host": {
"name": "Castle Defender Host",
"squads": [{ "type": 0, "tier": 10, "count": 300000, "modifiers": { "defense": 250.0 } }]
},
"joiners": [
{ "name": "Reinforcement 1", "squads": [{ "type": 2, "tier": 10, "count": 200000 }] }
]
}
}
res = requests.post(url, json=payload).json()
print(f"Rally Win Rate: {res['attackerWins'] / res['iterations']:.1%}")
for p in res["attackerParticipants"]:
print(f" {p['role']} '{p['name']}': Initial {p['initialTroopCount']:,} -> Dead: {p['dead']:,}, Injured: {p['injured']:,}")
/api/v1/optimize/troop-ratio and alias /api/v1/simulate/optimize-ratio.
import requests
url = "http://localhost:5000/api/v1/optimize/troop-ratio"
payload = {
"selectedScenario": 0,
"constraints": {
"totalTroopCount": 300000,
"stepPercent": 5.0,
"minInfantryPercent": 10.0,
"objective": 0 # 0 = MaxBattleScore, 1 = MaxWinRate, 2 = CasualtyTradeRatio (K/D), 3 = HospitalPreservation
},
"attackerTemplate": {
"name": "Attacker",
"squads": [
{ "type": 0, "tier": 10, "modifiers": { "attack": 120.0, "lethality": 100.0 } },
{ "type": 1, "tier": 10, "modifiers": { "attack": 120.0, "lethality": 100.0 } },
{ "type": 2, "tier": 10, "modifiers": { "attack": 120.0, "lethality": 100.0 } }
]
},
"defenderPlayer": {
"name": "Archer-Heavy Garrison",
"squads": [
{ "type": 0, "tier": 10, "count": 50000 },
{ "type": 1, "tier": 10, "count": 50000 },
{ "type": 2, "tier": 10, "count": 200000 }
]
}
}
res = requests.post(url, json=payload).json()
print(f"Optimal Ratio: {res['recommendedRatio']}")
print(f"Rationale: {res['recommendationRationale']}")
print(f"Tested {res['totalCombinationsTested']} combinations in {res['executionTimeMs']} ms")
import requests
url = "http://localhost:5000/api/v1/simulate/sensitivity-sweep"
payload = {
"selectedScenario": 0,
"config": {
"targetSide": 0, # 0 = Attacker, 1 = Defender
"primaryParameter": 0, # 0 = AllSquadsLethality
"comparisonParameter": 1, # 1 = AllSquadsAttack
"rangeMode": 0, # 0 = RelativeDelta (+/- from base)
"minValue": 0.0,
"maxValue": 50.0,
"stepValue": 10.0,
"iterationsPerPoint": 50
},
"attackerPlayer": { "name": "Attacker", "squads": [{ "type": 0, "tier": 10, "count": 100000 }] },
"defenderPlayer": { "name": "Defender", "squads": [{ "type": 0, "tier": 10, "count": 100000 }] }
}
res = requests.post(url, json=payload).json()
print(f"ROI Summary: {res['superiorStatSummary']}")
print(f"Insight: {res['comparativeRecommendation']}")
for pt in res["primarySeries"]["points"]:
print(f" {pt['label']}: Win Rate = {pt['winRate']:.1f}% | Casualties = {pt['avgAttackerCasualties']:,.0f}")
optimizationGoal: 0 = MaxBattleScore, 1 = MaxWinRate, 4 = CasualtyTradeRatio, 5 = HospitalPreservation) when optimizationMode is enabled.
import requests
url = "http://localhost:5000/api/v1/simulate/matchup-matrix"
payload = {
"presetName": "Season8",
"baselineBaseAttackPercent": 800.0,
"baselineBaseDefensePercent": 800.0,
"baselineBaseHealthPercent": 1000.0,
"baselineBaseLethalityPercent": 1000.0,
"totalTroopCount": 1000000,
"iterationsPerCell": 100,
"attackers": [
{ "lineupId": "s8_meta", "displayName": "Diego / Liz / Luna [S8 Meta]", "heroNames": ["Diego", "Liz", "Luna"] },
{ "lineupId": "s7_meta", "displayName": "Charles / Ava / Wee & Woo [S7 Meta]", "heroNames": ["Charles", "Ava", "Wee & Woo"] }
],
"defenders": [
{ "lineupId": "s8_meta", "displayName": "Diego / Liz / Luna [S8 Meta]", "heroNames": ["Diego", "Liz", "Luna"] },
{ "lineupId": "s7_meta", "displayName": "Charles / Ava / Wee & Woo [S7 Meta]", "heroNames": ["Charles", "Ava", "Wee & Woo"] }
]
}
res = requests.post(url, json=payload).json()
print(f"Completed {len(res['cells'])} matrix cells in {res['executionTimeMs']:.1f}ms")
PvP_RallyAttack, 1.25x/1.40x defender), City Garrison Defense (PvP_ReinforcedDefense, 1.25x/1.40x defender), and Neutral Structure / Turret (PvP_Outpost_Turret, 1.00x/1.00x symmetric). Eliminates V1 win-rate saturation by tracking netCasualtyDelta, winnerSurvivorsPercent, avgRounds, Peer-Gen vs Full-Field scores, and range spread (floor, peerAvg, fullAvg, ceiling). Supports optional joinerContext (0 = None, 1 = StandardMeta4x with 4x Chenko Atk / 4x Gordon Def) and troopRatioMode (0 = Standard502030, 1 = Optimized), and returns role leaderboards (rallyLeadRankings, garrisonLeadRankings, turretLeadRankings, flexRankings), individual heroRoleBreakdowns, and joinerLiftRankings. If attackers or defenders are omitted, presets are auto-loaded from presetName and maxSeasonLimit.
import requests
url = "http://localhost:5000/api/v1/simulate/matrix-v2"
payload = {
"presetName": "AllSeasons",
"maxSeasonLimit": 8,
"joinerContext": 1, # 0 = None, 1 = StandardMeta4x (4x Chenko / 4x Gordon)
"troopRatioMode": 0, # 0 = Standard502030, 1 = Optimized
"iterationsPerCell": 100,
"includeJoinerLift": True,
"joinerLiftIterations": 50
}
res = requests.post(url, json=payload).json()
print(f"Simulated {res['totalBattlesSimulated']} battles in {res['executionTimeMs']:.1f}ms")
print(f"Top Rally Lead: {res['rallyLeadRankings'][0]['displayName']} (Score: {res['rallyLeadRankings'][0]['compositeScore']:.1f})")
print(f"Top Garrison Lead: {res['garrisonLeadRankings'][0]['displayName']} (Score: {res['garrisonLeadRankings'][0]['compositeScore']:.1f})")
print(f"Top Flex Trio: {res['flexRankings'][0]['displayName']} (Score: {res['flexRankings'][0]['compositeScore']:.1f})")
PvE_Monster). Enforces strict zero hero overlap across all marches, sweeps PvE troop ratios, and returns the optimal portfolio, baseline greedy comparison (% lift), and top alternative portfolios.
import requests
payload = {
"ownedHeroes": [
{ "name": "Amadeus", "starLevel": 5, "subTier": 5, "widgetLevel": 5, "skillLevel": 5 },
{ "name": "Jabel", "starLevel": 5, "subTier": 5, "widgetLevel": 5, "skillLevel": 5 },
{ "name": "Marlin", "starLevel": 5, "subTier": 5, "widgetLevel": 5, "skillLevel": 5 },
{ "name": "Chenko", "starLevel": 5, "subTier": 5, "widgetLevel": 0, "skillLevel": 5 },
{ "name": "Yeonwoo", "starLevel": 5, "subTier": 5, "widgetLevel": 0, "skillLevel": 5 }
],
"troopTier": "T10",
"trueGoldLevel": 5,
"marchCapacity": 150000,
"numberOfJoinerMarches": 4,
"bossLevel": 5
}
res = requests.post("http://localhost:5000/api/v1/optimize/beartrap-portfolio", json=payload).json()
print(f"Optimal Damage: {res['optimalTotalDamage']:,.0f} (+{res['damageLiftPercent']:.2f}% vs Greedy)")
import requests
res = requests.post("http://localhost:5000/api/v1/simulate/predict-matrix", json=payload).json()
print(f"Screened {res['totalCombinationsScreened']} pairings in {res['executionTimeMs']:.2f}ms")
import requests
heroes = requests.get("http://localhost:5000/api/v1/heroes").json()
print(f"Loaded {len(heroes)} Heroes:")
for h in heroes[:5]:
print(f" - [{h['generation']}] {h['name']} ({h['troopType']})")
import requests
url = "http://localhost:5000/api/v1/heroes/shapley-ratings"
ratings = requests.get(url).json()
print(f"Top 5 Heroes by Shapley Marginal Attribution:")
for r in ratings[:5]:
print(f" - {r['heroName']} ({r['troopClass']}): Lift={r['marginalWinRateLift']:+.2f}%, Normalized={r['normalizedShapleyPower']:.1f}/100")
import requests
encounters = requests.get("http://localhost:5000/api/v1/encounters").json()
for e in encounters:
print(f"{e['encounterName']}: +{e['universalBuffPercent']}% Buffs | Inf: {e['infantryCount']} | Cav: {e['cavalryCount']} | Arc: {e['archerCount']}")
import requests
presets = requests.get("http://localhost:5000/api/v1/matrix/presets").json()
for p in presets:
print(f"{p['id']}: {p['name']} ({p['attackerCount']} lineups)")
.ksatk / .ksdef) and full battle setups (.ksbtl). Reports schema errors, squad counts, and total troop volume.
import requests
url = "http://localhost:5000/api/v1/presets/validate"
with open("my_march.ksatk", "r") as f:
json_text = f.read()
res = requests.post(url, json={"jsonContent": json_text}).json()
print(f"Is Valid: {res['isValid']} | Type: {res['detectedType']}")
print(f"Total Troops: {res['totalTroops']:,} across {res['squadCount']} squads")
if res["errors"]:
print(f"Errors: {res['errors']}")
multipart/form-data. The vision engine parses player identities, alliance tags, battle outcome, squad counts, TrueGold tiers, and all 12 core military troop stat bonuses for direct simulator population.
curl -X POST "http://localhost:5000/api/v1/ocr/battle-report" \
-F "files=@report_overview.jpg" \
-F "files=@report_stats.jpg"
import requests
url = "http://localhost:5000/api/v1/ocr/battle-report"
files = [
("files", ("report_overview.jpg", open("report_overview.jpg", "rb"), "image/jpeg")),
("files", ("report_stats.jpg", open("report_stats.jpg", "rb"), "image/jpeg"))
]
resp = requests.post(url, files=files)
data = resp.json()
print(f"Outcome: {data['report']['battleOutcome']}")
print(f"Attacker: {data['report']['attacker']['playerName']} ({data['report']['attacker']['totalSquad']} troops)")
print(f"Defender: {data['report']['defender']['playerName']} ({data['report']['defender']['totalSquad']} troops)")
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Json;
using var client = new HttpClient { BaseAddress = new Uri("http://localhost:5000") };
using var form = new MultipartFormDataContent();
form.Add(new ByteArrayContent(File.ReadAllBytes("report.jpg")), "files", "report.jpg");
var response = await client.PostAsync("/api/v1/ocr/battle-report", form);
var result = await response.Content.ReadFromJsonAsync<dynamic>();
Console.WriteLine($"Success: {result.success}, Outcome: {result.report.battleOutcome}");
slot, name, maxLevel, bonusPerLevel, bonusUnit, effectScope). Master configurations can be supplied as PlayerMasterConfig[] via attackerMasters/defenderMasters on /simulate/battle & /simulate/rally, player.masters, or masters on /optimize/beartrap-portfolio.
import requests
resp = requests.get("http://localhost:5032/api/v1/masters")
masters = resp.json()
for m in masters:
print(m["name"], "-", m["title"], len(m["skills"]), "skills")
"scenario" field on simulation endpoints as either integer ID or enum string name.
| Enum Name / Alias | Value | Category | Description | Casualty Split (Loss / Injured / Light) |
|---|---|---|---|---|
| PvP_SoloAttack Aliases: PvP_CityAttack, PvP_QuickFight |
0 |
Solo PvP | Attacking an enemy lord's city. Attacker suffers direct permanent losses. |
35% Dead / 10% Inj / 55% Light
|
| PvP_RallyAttack | 1 |
Rally PvP | Multi-player coordinated rally march against an enemy settlement or garrison. |
35% Dead / 10% Inj / 55% Light
|
| PvP_SoloDefense Alias: PvP_CityDefense |
2 |
Solo City Defense | Defending one's own city. No direct deaths (all route to infirmary up to capacity). |
0% Dead / 35% Inj / 65% Light
|
| PvP_ReinforcedDefense | 3 |
Reinforced City | Defending city fortified with friendly alliance reinforcement marches. |
0% Dead / 35% Inj / 65% Light
|
| PvP_KingsCastle | 4 |
Throne War | Battles for King's Castle central throne facility. Safe wounded mode. |
0% Dead / 35% Inj / 65% Light
|
| PvP_Outpost_Turret Aliases: PvP_Outpost_L1 .. L4 |
5 |
Alliance Facilities | Castle Turret and Outpost combat (neutral structure, 1.00x role multipliers). |
0% Dead / 35% Inj / 65% Light
|
| PvP_Fortress Alias: PvP_Sanctuary |
6 |
Alliance Facilities | Alliance Fortress and Sanctuary territorial garrison conflicts. |
0% Dead / 30% Inj / 70% Light
|
| Swordland_Building Aliases: Swordland_CityAttack, Swordland_CityDefense |
7 |
Cross-Server Event | Swordland / SVS cross-server event battlefield facilities. |
0% Dead / 30% Inj / 70% Light
|
| PvP_TileAttack Alias: PvP_TileDefense |
8 |
Field Skirmish | Resource gathering tile combat on the world map. |
0% Dead / 35% Inj / 65% Light
|
| PvP_HQBannerAttack Alias: PvP_HQBannerDefense |
9 |
Territory Defense | Alliance Headquarters and territory Banner attack/defense clashes. |
0% Dead / 35% Inj / 65% Light
|
| PvE_Monster Alias: PvE_Monster_Enemy (101) |
100 |
PvE Hunts | Beast, Lion, and Boss hunts. 100% lightly injured (instant zero-loss recovery). |
0% Dead / 0% Inj / 100% Light
|
The frontline meat shield. Absorbs 100% of standard enemy attacks until completely depleted. High base Defense and Health stats.
- โ๏ธ Deals Counter To: Cavalry (+10% Damage)
- ๐ก๏ธ Targeting Priority: Front Row (Takes all direct melee & ranged attacks)
- โญ Primary Scaling Hero: Eric, Amadeus, Zoe
High-speed shock troops. Features unique 20% Backline Flank penetration directly targeting enemy Archers past the front line.
- โ๏ธ Deals Counter To: Infantry (+10% Damage)
- ๐ฏ Targeting Split: 80% Enemy Frontline / 20% Direct onto Archers
- โญ Primary Scaling Hero: Petra, Margot, Helga
Back-row glass cannons. Highest base Attack and Lethality. Triggers Archer Volley strikes for $+10\%$ expected value damage.
- โ๏ธ Deals Counter To: Cavalry (+10% Damage)
- ๐น Special Feature: Archer Volley (+10% damage bonus EV)
- โญ Primary Scaling Hero: Jaeger, Saul, Chenko
Infantry $\to$ Cavalry $\to$ Archers $\to$ Infantry.
POST /api/v1/sensitivity/sweep).
| Parameter Name | Value | Scope | Description |
|---|---|---|---|
AllSquadsLethality | 0 | Global | Mutates Lethality % simultaneously across Infantry, Cavalry, and Archers. |
AllSquadsAttack | 1 | Global | Mutates Attack % across all troop squads. |
AllSquadsDefense | 2 | Global | Mutates Defense % across all troop squads. |
AllSquadsHealth | 3 | Global | Mutates Health (HP) % across all troop squads. |
InfantryLethality | 4 | Infantry | Mutates only Infantry squad Lethality %. |
InfantryAttack | 5 | Infantry | Mutates only Infantry squad Attack %. |
InfantryDefense | 6 | Infantry | Mutates only Infantry squad Defense %. |
InfantryHealth | 7 | Infantry | Mutates only Infantry squad Health %. |
CavalryLethality | 8 | Cavalry | Mutates only Cavalry squad Lethality %. |
CavalryAttack | 9 | Cavalry | Mutates only Cavalry squad Attack %. |
CavalryDefense | 10 | Cavalry | Mutates only Cavalry squad Defense %. |
CavalryHealth | 11 | Cavalry | Mutates only Cavalry squad Health %. |
ArcherLethality | 12 | Archers | Mutates only Archer squad Lethality %. |
ArcherAttack | 13 | Archers | Mutates only Archer squad Attack %. |
ArcherDefense | 14 | Archers | Mutates only Archer squad Defense %. |
ArcherHealth | 15 | Archers | Mutates only Archer squad Health %. |
LeaderWidgetLevel | 16 | Hero Widget | Sweeps primary hero widget level (1 through 10) evaluating staircase progression. |
TroopMultiplier | 17 | Troop Count | Scales player total army size multiplier ($0.1\times$ to $5.0\times$). |
| Mode Name | Value | Behavior & Mathematical Model | Recommended Use Case |
|---|---|---|---|
| Deterministic | 0 |
Expected-Value (EV) Math: Probabilities are mathematically folded into damage factors (e.g., $50\%$ chance for $+50\%$ damage = $1.25\times$ every tick). Produces identical, reproducible single-run trajectories. | Quick Fight, instant single-run calibration against Absy EV benchmarks. |
| Stochastic | 1 |
Probabilistic Dice Rolls: Evaluates discrete RNG rolls per attack/round for skill triggers, Margot dodges, and critical strikes. Simulates real in-game cascading variance and snowballing. | Multi-iteration Monte Carlo simulations (250โ10,000 battles) for true win rates and casualty bands. |
| Mode Name | Value | Behavior & Pipeline | Use Case |
|---|---|---|---|
| InReportDirect | 0 |
Direct Battle Report Stats (Default): Entered modifiers are used as-is for combat squads. Heroes contribute only active combat/expedition skill procs (no additive double-counting of hero star % or widgets). | Battle report imports (.ksbtl, .ksatk), OCR uploads, manual report matching. |
| ComponentBuilder | 1 |
Additive Component Builder: Starts from baseline account stats and additively incorporates Hero Star Base %, Widget %, Hero Gear, and granularComponents (pets, chiefGear, chiefCharms, warAcademy, researchTech, vip, citySkin, plus optional perTroopClass overrides for Infantry/Cavalry/Archers) via StatAggregator.
|
Profile builder, theorycrafting, Matchup Matrix simulations. |
allowedHeroNames (restricting candidates to owned heroes) and asymmetric userProfileOverride / heroOverrides (stars, subTier, widgetLevel, skillLevel), both also supported on POST /api/v1/simulate/matrix-v2.
import requests
url = "http://localhost:5000/api/v1/simulate/matchup-matrix"
payload = {
"presetName": "Season4",
"enableTwoStagePipeline": True,
"maxCandidatesToSimulate": 8,
"iterationsPerCell": 100,
"attackers": [
{
"lineupId": "s4_meta",
"displayName": "Alcar / Margot / Rosa",
"heroNames": ["Alcar", "Margot", "Rosa"],
"defaultRatio": { "infantryPercent": 50, "cavalryPercent": 20, "archerPercent": 30 }
}
],
"defenders": [
{
"lineupId": "s4_mirror",
"displayName": "Alcar / Margot / Rosa",
"heroNames": ["Alcar", "Margot", "Rosa"],
"defaultRatio": { "infantryPercent": 50, "cavalryPercent": 20, "archerPercent": 30 }
}
]
}
res = requests.post(url, json=payload).json()
print(f"Two-Stage Used: {res.get('twoStagePipelineUsed')}")
print(f"Screened {res.get('totalCandidatesScreened')} candidates in {res.get('stage1ScreenTimeMs')}ms")
userCustomLineup with custom Atk/Def/HP/Let%, TroopTier, TrueGoldLevel, heroOverrides, and formation ratio, or hydrated via userProfileOverride) against a fixed 5.0โ
meta benchmark roster (benchmarkPreset, optionally filtered by allowedHeroNames) as Attacker ($1 \times N$), Defender ($N \times 1$), or Both ($2N$). Also computes Nash Equilibrium meta weights (nashEquilibriumWeight) and Best-in-Class hero champions (bestAttackingInfantry, bestAttackingCavalry, bestAttackingArcher, bestDefendingInfantry, bestDefendingCavalry, bestDefendingArcher).
POST /api/v1/admin/maintenance/purge-telemetry with beforeUtc, excludeEngineVersion, excludeEventTag: "DragonTyrant", and dryRunOnly), database health inspection (GET /api/v1/admin/maintenance/status), empirical benchmark recalibration (POST /api/v1/admin/maintenance/regenerate-benchmarks), and Monte Carlo vs. Predictive Variance convergence monitoring (GET /api/v1/admin/maintenance/convergence). Protected by Personal Google OAuth 2.0 session cookies (/auth/google/login → /auth/google/callback, validated against AdminAuth:AllowedEmails) or the X-Admin-Key HTTP header matching AdminAuth:FallbackPasscode.
POST /api/v1/war-room/roster.
APT). Adds newly discovered members or enriches existing cards with new heroes, higher widget levels, or improved troop tiers.
?eventId={eventId} to filter intelligence strictly to a specific tactical event scope (defaults to the currently active event).
enemyName, case-sensitive allianceTag, kingdomId, roleFingerprint, troopTier, trueGoldLevel, and optional eventId) across all linked TransientEnemyDossiers rows for that enemy in the current event scope.
{"targetEventId": "..."}).
POST /api/v1/war-room/events, PUT /api/v1/war-room/events/{id}/activate, and DELETE /api/v1/war-room/events/{id}.