Overview
Stiletto uses a REST API backend built with Node.js. The API is available at stiletto-node-api on GitHub.Base URL
The API base URL is configured via theVITE_API_URL environment variable. All endpoints are relative to this base URL.
Authentication
Most API endpoints require authentication using a Bearer token obtained through Discord OAuth2.Authorization Header
Getting a Token
Authenticate with Discord and obtain an access tokenRequest Body:Response:
Users
Endpoints for managing user profiles and authentication.Get User Profile
Get the authenticated user’s profile informationAuthentication: RequiredResponse:
Update User Nickname
Update the authenticated user’s in-game nicknameAuthentication: RequiredRequest Body:Response:
true on successDelete User Account
Delete the authenticated user’s account and all associated dataAuthentication: RequiredResponse:
true on successUser Tech Tree
Get a user’s learned tech tree itemsAuthentication: RequiredQuery Parameters:
tree: Tech tree type (e.g., “crafting”, “combat”)
Update a user’s learned tech tree itemsAuthentication: RequiredQuery Parameters:Response: Updated tech tree info
tree: Tech tree type
Clans
Endpoints for clan creation, management, and information.Get Clan List
Get a list of clans with optional filteringAuthentication: Not requiredQuery Parameters:
name(optional): Filter by clan nameregion(optional): Filter by region
Get Clan Information
Get detailed information about a specific clanAuthentication: RequiredResponse:
Create Clan
Create a new clanAuthentication: RequiredQuery Parameters:
name: Clan name (required)symbol(optional): Clan symbol/emojiregion(optional): Clan regiondescription(optional): Clan description
Update Clan
Update clan information (leader only)Authentication: RequiredQuery Parameters:
name(optional): New clan namesymbol(optional): New clan symbolregion(optional): New clan regiondescription(optional): New clan description
Delete Clan
Delete a clan (leader only)Authentication: RequiredResponse:
true on successLeave Clan
Leave your current clanAuthentication: RequiredResponse:
Clan Members
Endpoints for managing clan membership and permissions.Get Clan Members
Get a list of all clan membersAuthentication: RequiredResponse:
Update Member
Accept, reject, or kick a clan memberAuthentication: RequiredQuery Parameters:
action: One ofaccept,reject,kick
Get Member Permissions
Get a member’s permissionsAuthentication: RequiredResponse:
Update Member Permissions
Update a member’s permissions (leader only)Authentication: RequiredQuery Parameters:
canEdit(optional): BooleancanInvite(optional): BooleancanKick(optional): Boolean
Diplomacy
Endpoints for managing clan relationships.Get Relationships
Get all diplomatic relationships for a clanAuthentication: RequiredResponse:
Create Relationship
Create a diplomatic relationship with another clanAuthentication: RequiredQuery Parameters:
otherclanid: ID of the other clan (required)relationshiptype: Type of relationship -ally,enemy, ornap(required)
Delete Relationship
Remove a diplomatic relationshipAuthentication: RequiredResponse:
Walkers
Endpoints for managing walker (vehicle) data.Get Walkers
Get a list of walkers with optional filteringAuthentication: RequiredQuery Parameters:
clanid(optional): Filter by clan IDtype(optional): Filter by walker type
Update Walker
Update walker informationAuthentication: RequiredRequest Body:Response:
Delete Walker
Delete a walkerAuthentication: RequiredResponse:
true on successTrading
Endpoints for the trading system.Get Trades
Get a list of active trade offersAuthentication: Not requiredQuery Parameters:
item(optional): Filter by item nametype(optional): Filter by trade type (buyorsell)
Create Trade
Create a new trade offerAuthentication: RequiredRequest Body:Response:
Delete Trade
Delete your own trade offerAuthentication: RequiredResponse:
true on successMaps
Endpoints for resource maps.Get Maps
Get a list of available mapsAuthentication: RequiredResponse:
Create Map
Create a new resource mapAuthentication: Optional (required for private maps)Query Parameters:
name: Map name (required)password(optional): Password for private map
Get Map
Get a specific map with markersAuthentication: Not requiredQuery Parameters:
mappass(optional): Password for private maps
Update Map
Update map information and markersAuthentication: Optional (required for owned maps)Request Body:Response:
Delete Map
Delete a mapAuthentication: RequiredResponse:
Get Map Info
Get map metadata without markersAuthentication: RequiredResponse:
Clusters
Endpoints for game cluster information.Get Clusters
Get a list of available game clusters/serversAuthentication: Not requiredResponse:
Discord Bot
Endpoints for Discord bot integration.Get Bot Configuration
Get Discord bot configuration for a clanAuthentication: RequiredResponse:
Update Bot Configuration
Update Discord bot configuration (leader only)Authentication: RequiredQuery Parameters:
guildid(optional): Discord server IDdiscordid(optional): Bot Discord user ID
Environment Variables
The following environment variables are required to configure the frontend:The public URL of the Stiletto web applicationExample:
https://stiletto.deeme.devThe base URL for the Stiletto APIExample:
https://api.stiletto.deeme.devURL for game resources (icons, maps, etc.)Example:
https://resources.stiletto.deeme.devPlausible Analytics URL (optional)Example:
https://plausible.ioError Handling
All API endpoints follow a consistent error handling pattern:Success Response
When a request succeeds, the API returns:- HTTP status code
200(OK) or204(No Content) - JSON response with the requested data or a success message
Error Response
When a request fails, the API returns:- Appropriate HTTP status code (400, 401, 403, 404, 500, etc.)
- The frontend throws an error with message
"errors.apiConnection"
Common Error Codes
400 Bad Request: Invalid request parameters401 Unauthorized: Missing or invalid authentication token403 Forbidden: Insufficient permissions404 Not Found: Resource not found500 Internal Server Error: Server-side error
Rate Limiting
The API may implement rate limiting to prevent abuse. Check the API repository for current rate limiting policies.CORS
The API supports Cross-Origin Resource Sharing (CORS) to allow requests from the Stiletto web application domain.Backend Repository
For more information about the API implementation, deployment, and contribution:- Current API: stiletto-node-api
- Legacy API: Stiletto-PHP-API (deprecated)
Related Documentation
- Discord Integration - Discord authentication and bot setup
- Environment Variables - Complete configuration guide