Skip to content
WasFor
Go boela gae
Tokomane/Motlhabolodi API

API ya Motsamaisi

Motsamaisi API o sebetsa ka sekepe. E tlhoka nako ya modirisi kgotsa — go ka nna botoka — senotlolo sa API se se nang le sekoupu. Mong le e mong ngola e ngotsweng ho boruni log le senotlolo kapa opareitara boitsebahatso.

Dintlha tsa bokhutlo

MokgwaTselaSekoupu
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X
WFP0XWFP0XWFP0X

Lenaane la badirisi

http
GET /api/admin/users?status=active&package=business&per_page=50
Authorization: Bearer <api-key>
json
{
  "ok": true,
  "data": [
    {
      "id": 1042,
      "email": "owner@acme.example",
      "package": "business",
      "node": "fra-01",
      "status": "active",
      "usage": { "disk_gb": 12.4, "sites": 6, "databases": 9, "mailboxes": 18 },
      "created_at": "2026-04-11T08:20:00Z"
    }
  ],
  "meta": { "page": 1, "per_page": 50, "total": 1 }
}

Tlhama modirisi

http
POST /api/admin/users
Idempotency-Key: 9b2f1c4d-6a3e-4f8b-9d1c-7e5a2b6f8c30

{
  "email": "new@acme.example",
  "package": "business",
  "node": "fra-01",
  "send_invite": true
}

Kopo e busetsa 201 ka selo sa akhaonto le seemo sa provisioning. Poll rekoto ya modirisi go fitlha status e nna active.

Emisa le go busetsa

http
POST /api/admin/users/1042/suspend
{ "reason": "overdue_invoice" }
http
PATCH /api/admin/users/1042
{ "status": "active" }

Go emisiwa go emisa diwebosaete le poso mme go boloka tshedimosetso. Lebaka le bolokwa ka fa gare mme le akareditswe mo tsenong ya boruni.

Dinoutu

http
GET /api/admin/nodes
json
{
  "ok": true,
  "data": [
    {
      "id": "fra-01",
      "region": "eu-central",
      "state": "healthy",
      "capacity": { "cpu": 8, "memory_gb": 32, "disk_gb": 500 },
      "usage": { "cpu_pct": 41, "memory_pct": 58, "disk_pct": 63 },
      "last_seen": "2026-12-01T09:15:12Z"
    }
  ]
}

Noutu e e mo seemong sa degraded kgotsa offline e tshwanetse go batlisisiwa pele ga go rulaganya diakhaonto tse dišwa.

Diphuthelwana

http
POST /api/admin/packages
{
  "name": "Business",
  "price_cents": 2900,
  "currency": "USD",
  "cycle": "monthly",
  "limits": { "disk_gb": 50, "sites": 25, "databases": 50, "mailboxes": 100 },
  "features": { "ssh": true, "git_deploy": true, "api": true }
}

Diphetogo tsa sephuthelwana ga di kwale gape diakhaonto tse di leng teng ka go boela morago ntle le fa apply_to_existing e le true, e e tlhomang tiro ya poelano mo meleng.

Dipusetso

http
POST /api/admin/orders/8812/refund
{ "amount_cents": 2900, "reason": "duplicate_charge" }

Dipusetso di na le maatla ka taelo le selekanyo. Mogala wa bobedi o o tshwanang o busetsa madi a ntlha go na le go ntsha o mosha.

Dinotlolo tsa API

http
POST /api/admin/api-keys
{
  "name": "billing-sync",
  "scopes": ["orders:read", "users:read"],
  "expires_in_days": 90
}

Sephiri se busiwa gangwe fela. E boloke mo motsamaisi wa sephiri; phanele e boloka hash fela.

Lokwalo lwa boruni

http
GET /api/admin/logs?action=user.suspend&from=2026-11-01&to=2026-12-01
json
{
  "ok": true,
  "data": [
    {
      "actor": "ops@example.com",
      "action": "user.suspend",
      "target": "customer:1042",
      "before": { "status": "active" },
      "after": { "status": "suspended" },
      "ip": "203.0.113.9",
      "at": "2026-12-01T09:14:22Z"
    }
  ]
}

Go tshwaragana le diphoso

Motsamaisi o kwala a ka palelwa ka WFP0X, WFP1X, conflict kgotsa provisioning_failed. Go palelwa ke go tlamela go akaretsa job_id; leka gape ka senotlolo se se tshwanang sa idempotency morago ga go baakanya se se bakang.

json
{
  "ok": false,
  "error": {
    "code": "scope_missing",
    "message": "API key lacks users:write",
    "request_id": "req_01J8Z5C1"
  }
}

Amana

E tlhabolotswe labofelo: 2026-12-01