{"openapi":"3.0.3","info":{"title":"Ping Cloud API","version":"1.0.0","description":"Provision and manage Ping Cloud servers from your own systems. Authenticate with an API key from your Ping Cloud account. Billing is prepaid: orders are paid from your wallet, and an order is refused when the wallet is short. Top up in the Ping Cloud dashboard.","contact":{"name":"Ping Africa","email":"support@ping.africa","url":"https://ping.africa/developers/cloud"}},"servers":[{"url":"https://cloud.ping.africa/api/v1","description":"Ping Cloud"}],"security":[{"ApiKey":[]}],"tags":[{"name":"Account","description":"Who the key acts for"},{"name":"Catalog","description":"Locations, images, plans and prices"},{"name":"Servers","description":"Create, read, start, stop, restart and delete servers"},{"name":"Kubernetes","description":"Kubernetes options and clusters"},{"name":"Billing","description":"Wallet, usage and invoices (read-only)"}],"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"pc_live_...","description":"Create a key in the Ping Cloud dashboard: Settings, API keys. It is shown once. Send it as `Authorization: Bearer pc_live_...`."}},"schemas":{"Error":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"INSUFFICIENT_RESOURCES"},"message":{"type":"string","example":"A node must be paid for when it is ordered. Required: 500.00, Available: 120.00. Please top up your account."},"details":{"type":"object"},"timestamp":{"type":"string","format":"date-time"}}}}},"Server":{"type":"object","properties":{"id":{"type":"string"},"vmid":{"type":"integer","description":"Numeric server number"},"name":{"type":"string"},"status":{"type":"string","enum":["PROVISIONING","RUNNING","STOPPED","PAUSED","SUSPENDED","UNKNOWN"]},"regionId":{"type":"string","example":"nairobi"},"cores":{"type":"integer"},"memory":{"type":"integer","description":"MB"},"disk":{"type":"integer","description":"GB"},"ipAddress":{"type":"string","nullable":true},"orgId":{"type":"string"},"pricingMode":{"type":"string","enum":["TEMPLATE_FIXED","RESOURCE_BASED"]},"monthlyPrice":{"type":"number","nullable":true},"prepaidUntil":{"type":"string","format":"date-time","nullable":true},"billingStatus":{"type":"string"},"liveStatus":{"type":"string","example":"running"},"createdAt":{"type":"string","format":"date-time"}}},"CreateServer":{"type":"object","required":["orgId","name","templateId","cores","memory","disk","cloudInit"],"properties":{"orgId":{"type":"string"},"name":{"type":"string","description":"Letters, numbers and hyphens; 1-63 characters","example":"web-1"},"planId":{"type":"string","description":"A plan `id` from GET /pricing/public. With a plan, send exactly its cores, memory and disk."},"templateId":{"type":"integer","description":"Operating system image (`templateId` from GET /templates?purpose=os)","example":8001},"cores":{"type":"integer","minimum":1,"example":1},"memory":{"type":"integer","minimum":512,"description":"MB","example":1024},"disk":{"type":"integer","minimum":8,"description":"GB","example":20},"cloudInit":{"type":"object","required":["hostname","username"],"properties":{"hostname":{"type":"string","example":"web-1"},"username":{"type":"string","example":"ubuntu"},"password":{"type":"string","description":"Optional; one is generated and returned once if empty"},"sshKeys":{"type":"string","description":"Public keys, one per line"}}},"networkType":{"type":"string","enum":["PUBLIC","PRIVATE"],"default":"PUBLIC"}}}},"responses":{"E400":{"description":"Validation failed (see `error.details.issues`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"Missing, invalid or revoked API key, or an endpoint that does not take a key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E402":{"description":"Wallet balance too low for the order (top up in the dashboard)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E403":{"description":"Outside your organization, or your role does not allow it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"Not found (or not in your organization)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Rate limit reached; retry after `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/me":{"get":{"tags":["Account"],"summary":"Who the key acts for","description":"The key, its rate limit, and the one organization it acts for (with your role there).","responses":{"200":{"description":"The caller","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/regions":{"get":{"tags":["Catalog"],"summary":"Locations","responses":{"200":{"description":"Active regions","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"nairobi"},"displayName":{"type":"string","example":"NAIROBI"},"location":{"type":"string","example":"Nairobi, Kenya"}}}},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/templates":{"get":{"tags":["Catalog"],"summary":"Operating system images and plans","parameters":[{"name":"purpose","in":"query","schema":{"type":"string","enum":["os","plans"]},"description":"`os`: images to install (use `templateId`); `plans`: fixed-price plans"},{"name":"type","in":"query","schema":{"type":"string","enum":["shared","dedicated","all"]}}],"responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object"}},"message":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/pricing/public":{"get":{"tags":["Catalog"],"summary":"Plans and prices","description":"Fixed-price plans (shared and dedicated, monthly, KES) and the per-resource rates for custom sizes. Prices are standard Ping Cloud prices.","responses":{"200":{"description":"Plans and rates","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"shared":{"type":"array","items":{"type":"object"}},"dedicated":{"type":"array","items":{"type":"object"}},"customRates":{"type":"object"}}},"message":{"type":"string"}}}}}},"429":{"$ref":"#/components/responses/E429"}}}},"/pricing":{"get":{"tags":["Catalog"],"summary":"Resource price list","responses":{"200":{"description":"Pricing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/kubernetes/pricing":{"get":{"tags":["Kubernetes"],"summary":"Kubernetes tiers, node sizes and prices","responses":{"200":{"description":"Kubernetes pricing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/vms":{"get":{"tags":["Servers"],"summary":"List servers","parameters":[{"name":"orgId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Servers","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"vms":{"type":"array","items":{"$ref":"#/components/schemas/Server"}}}},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"tags":["Servers"],"summary":"Create a server","description":"Charges the first month from the wallet when the order is placed. Refused with 402 when the wallet cannot pay in full or anything is owed; there is no credit or overdraft through the API. Capacity is checked when the order is placed. The response carries the login credentials once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateServer"}}}},"responses":{"201":{"description":"Server ordered; status is PROVISIONING until ready","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"id":{"type":"string"},"vmid":{"type":"integer"},"name":{"type":"string"},"ipAddress":{"type":"string"},"credentials":{"type":"object"}}},"message":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"402":{"$ref":"#/components/responses/E402"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/vms/{vmId}":{"parameters":[{"name":"vmId","in":"path","required":true,"schema":{"type":"string"},"description":"Server id (`id` from create or list)."}],"get":{"tags":["Servers"],"summary":"Get a server","responses":{"200":{"description":"The server","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Server"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"delete":{"tags":["Servers"],"summary":"Delete a server","description":"Stops billing for the server and removes it. Cannot be undone.","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/vms/{vmId}/actions":{"parameters":[{"name":"vmId","in":"path","required":true,"schema":{"type":"string"},"description":"Server id (`id` from create or list)."}],"post":{"tags":["Servers"],"summary":"Start, stop or restart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["start","stop","restart"]}}}}}},"responses":{"200":{"description":"Action started","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/vms/{vmId}/status":{"parameters":[{"name":"vmId","in":"path","required":true,"schema":{"type":"string"},"description":"Server id (`id` from create or list)."}],"get":{"tags":["Servers"],"summary":"Live status","responses":{"200":{"description":"Status, CPU, memory, uptime","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/kubernetes/clusters":{"get":{"tags":["Kubernetes"],"summary":"List clusters","parameters":[{"name":"orgId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Clusters","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/kubernetes/clusters/{clusterId}":{"parameters":[{"name":"clusterId","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Kubernetes"],"summary":"Get a cluster","responses":{"200":{"description":"The cluster","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}},"delete":{"tags":["Kubernetes"],"summary":"Delete a cluster","responses":{"200":{"description":"Deleting","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/organizations/{orgId}/usage/summary":{"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"},"description":"Your organization id (from GET /me)."}],"get":{"tags":["Billing"],"summary":"Usage and charges this period, wallet balance, top-ups","parameters":[{"name":"month","in":"query","schema":{"type":"string","example":"2026-11"},"description":"YYYY-MM; default is the current month"}],"responses":{"200":{"description":"Summary","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"period":{"type":"object"},"currency":{"type":"string","example":"KES"},"wallet":{"type":"object","properties":{"balance":{"type":"number"},"reserved":{"type":"number"},"available":{"type":"number"}}},"totals":{"type":"object"},"usage":{"type":"object"},"charges":{"type":"array","items":{"type":"object"}},"topUps":{"type":"array","items":{"type":"object"}}}},"message":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/organizations/{orgId}/credits/balance":{"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"},"description":"Your organization id (from GET /me)."}],"get":{"tags":["Billing"],"summary":"Wallet balance","responses":{"200":{"description":"Balance","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/organizations/{orgId}/credits/transactions":{"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"},"description":"Your organization id (from GET /me)."}],"get":{"tags":["Billing"],"summary":"Wallet transactions","responses":{"200":{"description":"Transactions","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/organizations/{orgId}/usage":{"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"},"description":"Your organization id (from GET /me)."}],"get":{"tags":["Billing"],"summary":"Resource usage against limits","responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/organizations/{orgId}/invoices":{"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"},"description":"Your organization id (from GET /me)."}],"get":{"tags":["Billing"],"summary":"Invoices","responses":{"200":{"description":"Invoices","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/organizations/{orgId}/invoices/{invoiceId}":{"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"},"description":"Your organization id (from GET /me)."},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Billing"],"summary":"Invoice detail","responses":{"200":{"description":"Invoice","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"},"message":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}}}}