API / Getting started / API overview

API overview

The sourhost API does what the panel does, for your own scripts, bots and CI: look at servers, restart them, edit configs, renew rentals. Plain HTTP and JSON.

Base URL

Every method lives under:

HTTP
https://sourhost.net/api/v1

v1 is stable: new fields may appear in responses, existing ones don't change or disappear.

Authentication

Every request carries a personal API token in the Authorization header. Create one under Settings → API tokens; see API tokens.

curl "https://sourhost.net/api/v1/me" \
  -H "Authorization: Bearer $SOURHOST_TOKEN"

Response:

HTTP
HTTP/2 200 OK
{
  "id": 27,
  "email": "[email protected]",
  "balance": 1250,
  "timezone": "Europe/Kyiv"
}

Keep the token like a password: in environment variables or a secret manager, never in code or a repository. If it leaks, revoke it in Settings and it stops working at once.

Format

WhatHow
Request bodyJSON with Content-Type: application/json. The exception: support tickets take form fields
ResponseJSON. A success with no body is a 204
MoneyWhole hryvnias (UAH)
DatesISO 8601 in UTC, e.g. 2026-12-01T00:00:00Z
IDsNumeric strings like "34" — take them from list responses

Where to start

  1. Create a token with the scopes you need — API tokens.
  2. Find the project and server: GET /projects, then GET /projects/:id/services — reference.
  3. Manage the server — managing a server.
  4. Read up on errors and limits.