SweatHost
HTTP API Reference

Authentication

Authenticate with the SweatHost HTTP API using API keys

Authentication

All API requests (except GET /api/v1/regions) require an API key passed in the Authorization header.

Getting an API key

  1. Log in to your SweatHost Dashboard
  2. Navigate to API Keys in the sidebar
  3. Click Create API Key
  4. Select the scopes your application needs
  5. Copy the API key — it is only shown once

Required headers

HeaderRequiredDescription
AuthorizationYesBearer <your-api-key>
Content-TypePOST/PATCH onlyapplication/json

Example request

curl -X GET "https://api.sweathost.com/api/v1/game-servers" \
  -H "Authorization: Bearer YOUR_API_KEY"

POST/PATCH requests

curl -X POST "https://api.sweathost.com/api/v1/game-servers" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Server", "gameType": "cs2", "region": "us-west-1", "configuration": {...}}'

API key scopes

ScopeAllows
servers:readList, get, getStatus servers; read matches, deathmatch sessions, regions
servers:writeCreate, update, delete servers; start sessions, RCON, retry provisioning
servers:controlStart, stop, restart servers
matches:readRead match data and statistics
matches:writeCreate and update matches
regions:readRead region information

Auth errors

HTTPCause
401 UnauthorizedMissing or invalid API key
403 ForbiddenAPI key lacks the required scope, or resource belongs to another organization
# Test your API key
curl -X GET "https://api.sweathost.com/api/v1/game-servers?page=1&pageSize=1" \
  -H "Authorization: Bearer YOUR_API_KEY"

A successful response (even with 0 servers) confirms your key is valid.

On this page