SweatHost
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

ResourceBase pathDescription
AuthenticationAPI key setup and auth headers
Game Servers/api/v1/matches, /api/v1/serversCreate matches, get server status, cancel matches
Matches/api/v1/cs2CS2 series and match data
Deathmatch/api/v1/cs2/deathmatchDeathmatch sessions, stats, leaderboards
Match Stats/api/v1/cs2/matches/:mapId/statsFull match analytics
Regions/api/v1/regionsAvailable server regions

Common patterns

Authentication

Every request requires an Authorization header:

Authorization: Bearer YOUR_API_KEY

Content type

For POST and PATCH requests, include:

Content-Type: application/json

Pagination

List endpoints support pagination via query parameters:

ParameterTypeDefaultDescription
pagenumber1Page number (1-indexed)
pageSizenumber20Items 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"
}
HTTPCodeDescription
400INVALID_PARAMSInvalid request body or query
401UNAUTHORIZEDInvalid or missing API key
403FORBIDDENInsufficient permissions or wrong organization
404NOT_FOUNDResource 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.

On this page