usagestatistics — WAP API
Read account usage statistics through the WAP root administrator API, with request fields, response details, errors and cURL/Python/PHP examples.
/api/v1/usagestatistics/Also accepts GETReturns stored hosting-account records keyed by username with current-month recorded quota_usage and bandwidth_usage in MB. Resellers also include reseller_data, quota_usage_reseller and bandwidth_usage_reseller. Missing per-user metrics default to zero; that does not prove a fresh measurement. Individual unreadable account records are skipped. These are recorded accounting values, not an on-demand scan, and no date-range or pagination parameters are declared.
Request
| Property | Value |
|---|---|
| Methods | GET, POST |
| Versioned path | /api/v1/usagestatistics/ |
| Default path | /api/usagestatistics/ |
| Authentication | WAP root administrator API credentials. |
| Header | Required value |
|---|---|
X-API-USER | Your WAP API username. |
X-API-PASSWORD | Its API password. |
No endpoint-specific query or body fields are required.
Replace server.example.com, billing_api and YOUR_API_PASSWORD in each standalone example. Replace operation sample values with your actual target and an existing package where required. Python needs Requests; PHP needs the cURL extension. These examples make real calls when run.
Success response
HTTP 200. Illustrative values; account records and server values vary. Stored account examples show only selected fields.
{
"data": {
"users": {
"exampleuser": {
"user": "exampleuser",
"domain": "example.com",
"is_suspended": "no",
"is_reseller": "no",
"quota_usage": 128,
"bandwidth_usage": 512
}
}
},
"info": "Eenos usage metics",
"status": 200
}| Field | Type | Meaning |
|---|---|---|
status | integer | 200 on the documented success branch. |
info | string | Operation description. |
data | object | Operation data described below. |
data.users | object | Hosting-account records keyed by username, including recorded usage. |
Account record contents are not a fixed public schema. Fields such as user/domain and nested limits depend on account configuration; reseller_data appears only where the handler adds it. Do not expose entire administrator responses to an end-user browser.
is_suspended and is_reseller are strings (yes/no), not booleans. quota_usage and bandwidth_usage are recorded current-month MB values; reseller records also contain quota_usage_reseller and bandwidth_usage_reseller.
Errors and demo mode
| Condition | Actual HTTP status | Response behavior |
|---|---|---|
| Missing credentials with no other authenticated identity | 403 | detail: Authentication credentials were not provided. |
| Rejected password or source IP | 403 | detail: Invalid API credentials |
| Demo server | 400 | error: Demo server; info: Api Operations not available in demo server; JSON status: 403. |
| Caught backend exception | 400 | Exception text in error; JSON status: 500. |
| Unsupported method | 405 after authentication | Method-not-allowed response. |
Check both the HTTP status and JSON shape. Authentication failures do not use the operation envelope. Unexpected uncaught server errors are not guaranteed to return the documented JSON shape. Do not automatically retry account creation, password changes, deletions or SSO generation after a timeout: confirm the actual state first.