# ServerBike Reseller Public API — reference Contract **1.1.1** (Bridge 0.1.8 maintenance). Base URL `https://bridge.serverbike.com`. Machine-readable contract: [`openapi.yaml`](openapi.yaml) (OpenAPI 3.1). Signing: [`AUTHENTICATION.md`](AUTHENTICATION.md). **28 routes: 17 GET, 11 POST.** Every route requires the four signing headers and a registered source address. ## Conventions | Topic | Rule | | --- | --- | | Success | HTTP 200, body `{"data": {...}}`, `Content-Type: application/json`, `Cache-Control: no-store`, no `Content-Encoding`. | | Errors | `{"error": {"code", "message", "details"}}` and an `X-Request-Id` header. Business errors carry `details.operation_uuid`. | | Identifiers | Path identifiers are canonical lowercase UUIDs. Business `operation_uuid` values are random UUID v4 that you generate and store. | | Money | `{"amount": "4.99", "currency": "USD"}` — decimal strings with two places, never floats. | | Time | RFC 3339 UTC with seconds, e.g. `2026-11-24T10:00:00Z`. | | Reads | GET with an empty body and only the documented query parameters; anything else is `400 INVALID_REQUEST`. | | Bodies | Exact JSON objects with the listed members (no extra or duplicate members). `Idempotency-Key` is not used. | | Ownership | Another reseller's (or an unknown) service or operation is `404 NOT_FOUND`; `GET /operations/{o}` answers `200 not_found`. | | Capabilities | Runtime actions need the product capability (`vps.start`, `vps.stop`, `vps.restart`, `vps.poweroff`, `vps.reinstall`, `vps.changepassword`, `vps.console`) at the moment of the request. | | Rate families | Per minute in Production: `read` 60, `polling` 60, `mutation` 10, `auth_probe` 10; plus per-source-address 60, per-credential 60, per-reseller 60 and 10 authentication failures. `429` carries `Retry-After`. | ## Routes | Method | Path | Family | Since | Purpose | | --- | --- | --- | --- | --- | | GET | `/api/v1/auth/verify` | auth_probe | 1.0 | Prove credential, signature and source address. | | GET | `/api/v1/catalog` | read | 1.0 | Products, terms, wholesale prices (`limit` ≤ 10, `cursor`). | | GET | `/api/v1/account/commercial` | read | 1.0 | Eligibility and credit balance. | | POST | `/api/v1/purchases` | mutation | 1.0 | Buy one VPS (one debit). | | POST | `/api/v1/renewals` | mutation | 1.0 | Renew one service (one debit). | | POST | `/api/v1/commercial-suspensions` | mutation | 1.0 | Commercial suspension. | | POST | `/api/v1/commercial-unsuspensions` | mutation | 1.0 | Release a suspension. | | POST | `/api/v1/commercial-terminations` | mutation | 1.0 | Terminate (provider cleanup follows). | | POST | `/api/v1/commercial-changes` | mutation | 1.0 | Deferred plan change (upgrade). | | GET | `/api/v1/operations/{operation_uuid}` | polling | 1.0 | Durable outcome of a business operation. | | GET | `/api/v1/operations/{operation_uuid}/settlement` | read | 1.1.0 | Recorded amounts, currency, paid-through, escrow. | | GET | `/api/v1/services` | read | 1.0 | Your services (`limit` ≤ 100, `cursor`). | | GET | `/api/v1/services/{service_uuid}` | read | 1.0 | One service. | | GET | `/api/v1/services/{service_uuid}/commercial` | read | 1.1.0 | Paid-through, renewal authority, capabilities, upgrade targets. | | GET | `/api/v1/services/{service_uuid}/operational-status` | read | 1.0 | Live power status. | | GET | `/api/v1/services/{service_uuid}/runtime-state` | read | 1.0 | Progress, power, CPU, memory, disk, traffic. | | GET | `/api/v1/services/{service_uuid}/activity` | read | 1.0 | Latest 30 events. | | GET | `/api/v1/services/{service_uuid}/access` | read | 1.0 | Legacy delivery projection. | | GET | `/api/v1/services/{service_uuid}/guest-access` | read | 1.1.0 | Image-aware login (SSH/RDP), credential state and recovery. | | POST | `/api/v1/services/{service_uuid}/access/initial-credential` | mutation | 1.0 | One-time initial password reveal. | | POST | `/api/v1/services/{service_uuid}/console-sessions` | mutation | 1.0 | One-use console ticket. | | POST | `/api/v1/services/{service_uuid}/power/{action}` | mutation | 1.0 | `start`, `stop`, `restart`, `poweroff`. | | GET | `/api/v1/services/{service_uuid}/power/operations/{operation_uuid}` | read | 1.0 | Observe a power operation. | | POST | `/api/v1/services/{service_uuid}/reinstall` | mutation | 1.0 | Reinstall an image with a new password. | | GET | `/api/v1/services/{service_uuid}/reinstall/operations/{operation_uuid}` | read | 1.0 | Observe a reinstall. | | POST | `/api/v1/services/{service_uuid}/password` | mutation | 1.0 | Change the guest password. | | GET | `/api/v1/services/{service_uuid}/password/operations/{operation_uuid}` | read | 1.0 | Observe a password change. | | GET | `/api/v1/services/{service_uuid}/plan-changes/{operation_uuid}` | polling | 1.1.0 | Plan change phase and customer activation readiness. | All GET routes are **observational**: they never send a provider command. Restarts, provider-requested power cycles and settlements are continued by the platform's own worker, so your client does not need to keep polling for an operation to finish (polling only tells you when it has). ## Status vocabularies | Where | Values | Terminal success | Terminal failure | | --- | --- | --- | --- | | Business lookup `status` | `not_found`, `pending`, `committed`, `rejected` | `committed` | `rejected` (with `rejection_code`) | | Power / reinstall `status` | `pending`, `new`, `in_flight`, `command_acknowledged`, `unknown`, `unknown_sent_outcome`, `complete`, `failed_definitely_not_sent`, `failed_provider_rejected`, `reconciliation_required` | `complete` | `failed_definitely_not_sent`, `failed_provider_rejected` | | Password `status` | `pending`, `changing`, `applying`, `complete`, `power_cycle_required`, `failed_provider_rejected`, `failed_definitely_not_sent`, `reconciliation_required` | `complete` | `failed_*`; `power_cycle_required` is a final instruction to the customer | | Plan change `phase` | see [`LIFECYCLE_AND_RECONCILIATION.md`](LIFECYCLE_AND_RECONCILIATION.md#plan-change) | `completed` | `released`, `rejected` | `reconciliation_required` is not a failure: the platform keeps settling it from provider evidence. Escalate to ServerBike support when it persists for more than an hour. ## Errors | HTTP | `code` | Meaning | What to do | | --- | --- | --- | --- | | 400 | `INVALID_REQUEST` | Malformed identifier, query, body, media type or size. | Fix the request. | | 401 | `AUTHENTICATION_FAILED` | Signature, timestamp, nonce replay, credential or source address refused. | Check clock, signing and registered addresses; re-sign. | | 404 | `NOT_FOUND` | Unknown, foreign, or not offered. | Check the identifier and ownership. | | 405 | `METHOD_NOT_ALLOWED` | Wrong method for the path. | — | | 409 | `SERVICE_SUSPENDED` | The service is commercially held. | — | | 409 | `BUSINESS_CONFLICT` | Another operation is open, wrong state, or refused by policy. | Look up the open operation; do not loop. | | 409 | `IDEMPOTENCY_CONFLICT` | The `operation_uuid` was used for a different intent. | Use the original body, or a new UUID for a new intent. | | 422 | `PRODUCT_UNAVAILABLE`, `RESELLER_INELIGIBLE`, `INSUFFICIENT_CREDIT`, `NOT_FOUND` | Definite business refusal; nothing was charged. | — | | 429 | `RATE_LIMITED` | Too many requests. | Wait `Retry-After`, re-sign. | | 500 | `INTERNAL_ERROR` | Unexpected. After a POST the outcome is unknown. | Look the operation up. | | 503 | `UPSTREAM_UNAVAILABLE` | A dependency cannot answer. On a business POST it is proven not sent. | Retry the same intent later. | | 503 | `OUTCOME_UNKNOWN` | The business call may have committed. | Poll the original `operation_uuid`. | Anything that is not this JSON envelope (an HTML page, a CDN or proxy error, a challenge page, a timeout) is a **transport** result, not a Bridge answer — see [`RETRY_AND_ERRORS.md`](RETRY_AND_ERRORS.md).