Skip to main content

Smoke tests

Smoke tests (TS-1) verify that each API endpoint behaves correctly: status codes, response shape, and key fields. They do not exhaustively test business rules.

Scope

  • HealthGET /v1/healthsuccess, data.status === "ok", data.version, meta.request_id (e.g. req_*).
  • RegisterPOST /v1/account/register → 201, data.api_key (e.g. ak_ prefix), data.api_secret (e.g. sk_), data.status === "active", data.trial.is_trial === true.
  • AuthPOST /v1/auth/token with api_key + api_secret → data.access_token (JWT), data.token_type === "Bearer", data.expires_in, data.agent.permissions includes expected scopes.
  • Account infoGET /v1/account/info with X-API-Key → data.agent_id, data.status, data.rate_limit, data.auth_mode.
  • ProductsGET /v1/products (and ?type=dynamic) → data.items array, each with product_no, name, type, price, unit.
  • RegionsGET /v1/products/regionsdata.items with code, name.
  • Session create (dynamic)POST /v1/sessions with type dynamic, valid product_no → 202 or 201, data.session_id (e.g. sess_), data.status === "creating" or active. Poll until active; assert data.proxy present, data.health.health_score, data.health.risk_level.
  • Session create (static) — Same with type static; assert active or creating and proxy/expires_at when active.
  • Session listGET /v1/sessions, ?status=active, ?type=dynamic → pagination and items.
  • Session rotatePOST /v1/sessions/{id}/rotate with reason → data.new_proxy or updated proxy, data.rotated_at.
  • Session renewPOST /v1/sessions/{id}/renew (static) → data.expires_at extended.
  • Session terminatePOST /v1/sessions/{id}/terminatedata.status === "terminated"; GET same id confirms terminated.
  • Billing balanceGET /v1/billing/balancedata.balance, data.currency.
  • Billing rechargePOST /v1/billing/recharge with amount → 201, data.order_id, data.status (e.g. pending). Do not perform real payment.
  • Billing recharge statusGET /v1/billing/recharge/{order_id}/status → order_id, status.
  • Billing transactionsGET /v1/billing/transactions?page=1&page_size=10data.items, data.pagination.
  • Telemetry reportPOST /v1/sessions/{id}/report-event (success, http_error, block) → data.session_health with risk_level, recommendation.
  • Telemetry batchPOST /v1/telemetry/batch with events array → data.processed, data.results.
  • Session healthGET /v1/sessions/{id}/health → health_score, success_rate, recommendation, stats.
  • Stats overviewGET /v1/stats/overview → balance, active_sessions, total_sessions, etc.

Request shapes

Use real field names from the API: e.g. type, config.product_no, config.traffic_gb for dynamic; config.quantity, config.duration_days for static. Session create may use type + config (not session_type in request body for some implementations — align with actual API). Idempotency-Key sent on create/renew where supported. Next: Integration tests, E2E.