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/v1v1 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
| What | How |
|---|---|
| Request body | JSON with Content-Type: application/json. The exception: support tickets take form fields |
| Response | JSON. A success with no body is a 204 |
| Money | Whole hryvnias (UAH) |
| Dates | ISO 8601 in UTC, e.g. 2026-12-01T00:00:00Z |
| IDs | Numeric strings like "34" — take them from list responses |
Where to start
- Create a token with the scopes you need — API tokens.
- Find the project and server:
GET /projects, thenGET /projects/:id/services— reference. - Manage the server — managing a server.
- Read up on errors and limits.