HTTP API Reference
HTTP API Reference
Use the SweatHost API directly with cURL, Rust, Go, Python, or any HTTP client
HTTP API Reference
The SweatHost HTTP API lets you create matches, manage servers, and access match data from any language — no SDK required. All endpoints return JSON and use standard HTTP methods.
Base URL
All API requests use the base URL: https://api.sweathost.com
Quick example
# Start an ephemeral match (single call — creates server, allocates pod, starts game)
curl -X POST "https://api.sweathost.com/api/v1/matches" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"region": "us-west-1",
"gameType": "cs2",
"gameSettings": {
"matchType": "competitive",
"map": "de_dust2",
"seriesFormat": "bo1"
}
}'Endpoints overview
| Resource | Base path | Description |
|---|---|---|
| Authentication | — | API key setup and auth headers |
| Game Servers | /api/v1/matches, /api/v1/servers | Create matches, get server status, cancel matches |
| Matches | /api/v1/cs2 | CS2 series and match data |
| Deathmatch | /api/v1/cs2/deathmatch | Deathmatch sessions, stats, leaderboards |
| Match Stats | /api/v1/cs2/matches/:mapId/stats | Full match analytics |
| Regions | /api/v1/regions | Available server regions |
Common patterns
Authentication
Every request requires an Authorization header:
Authorization: Bearer YOUR_API_KEYContent type
For POST and PATCH requests, include:
Content-Type: application/jsonPagination
List endpoints support pagination via query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (1-indexed) |
pageSize | number | 20 | Items per page (max: 100) |
Response shape:
{
"page": 1,
"pageSize": 20,
"total": 42,
"items": [...]
}Errors
All errors return a JSON body:
{
"statusCode": 401,
"message": "Unauthorized",
"error": "UNAUTHORIZED"
}| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS | Invalid request body or query |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 403 | FORBIDDEN | Insufficient permissions or wrong organization |
| 404 | NOT_FOUND | Resource not found |
SDK available
If you're using JavaScript or TypeScript, the @sweathost/sdk package provides a typed client with built-in error handling. The HTTP API docs are for non-JS backends.