Skip to main content
A sub-user is a gateway account belonging to one of your customers: a username, a password, and a data limit drawn from your pool. Creating one debits your unassigned data immediately.

Creating a sub-user

POST /reseller/users

cURL

Request Fields

200 OK
Credentials stay retrievable from the list and detail endpoints. This is not a one-time reveal, so you don’t have to store the password yourself.

Errors

There is no “not enough data” error. The pool is tracked, not enforced — assigning more than you’ve purchased just drives remainingBytes negative.

Listing your sub-users

GET /reseller/users

Paginated, with stored credentials and assigned totals. Accepts page and limit (default 25, max 100).
cURL
Add includeUsage=true to include each sub-user’s live consumption from the gateway. This costs one gateway lookup per row, so the request gets slower as the page grows — use it for dashboard views, not high-frequency polling. 200 OK
If a live lookup fails for one row, that row comes back with "usage": null and a usageError note rather than failing the whole request. Handle null usage as “unknown”, not as zero.

Checking one sub-user

GET /reseller/users/:username

A single sub-user with live usage — this is the endpoint for “how much data has this customer consumed?”
cURL
200 OK
If the gateway is unreachable the credentials still return, with "usage": null and a usageError note. When rawUsed >= rawTotal the account is exhausted and stops working. Top it up to reactivate it.

Adjusting a sub-user’s data

POST /reseller/users/:username/data

Takes a signed GB delta. Positive tops up, negative takes unconsumed data back.
cURL
Rules:
  • Range is ±10,000 GB. Zero is rejected.
  • An assignment can never go below zero — removing more than is currently assigned is a 400.
  • Removal only reclaims unconsumed data. Data your customer already used is gone.
200 OK
A 502 means nothing was charged and a retry is safe.

Deleting a sub-user

DELETE /reseller/users/:username

Ends a customer’s access and reclaims what they didn’t use.
cURL
200 OK
What happens, in order:
  1. The account’s unconsumed quota is drained upstream — the credentials stop working.
  2. The unconsumed portion is refunded to your unassigned allocation.
  3. The record is removed from your account.
Consumption history for your account is preserved, so deleting a sub-user doesn’t erase it from your usage history.
Deletion is irreversible. To give the same customer access again, create a new sub-user — and prefer a fresh username, since the old account still exists upstream in a drained state.
If the gateway cannot be reached, the deletion aborts with a 502 and nothing changes — retry later.