Data you assign to a sub-user comes out of your unassigned pool right away. The pool is tracked, not enforced, so you never get a “not enough data” error.
remainingBytes just goes negative.
All examples read your key from the
RESELLER_KEY environment variable. See Authentication.
Create a Sub-User
POST /reseller/users
- Node.js
- Python
- cURL
Node.js
Request Parameters
Response
Response
Errors
Username taken (409)
Username taken (409)
The message is
Username "x" is already taken. Pick another one. Choose a different username, or leave it out to get a generated one.Proxy network rejected the account (502)
Proxy network rejected the account (502)
Nothing was created and no data was taken. You can safely retry.
Invalid request (400)
Invalid request (400)
A field breaks the rules above.
message is a list of strings, one for each problem.List Sub-Users
GET /reseller/users
- Node.js
- Python
- cURL
Node.js
Query Parameters
Response
Response
Get One Sub-User
GET /reseller/users/:username
Returns one sub-user with live usage. Use it to see how much data a customer has used.
- Node.js
- Python
- cURL
Node.js
Response
Response
If usage can’t be looked up, you still get the credentials, with
"usage": null and a usageError note.
Change Data
POST /reseller/users/:username/data
Send a GB amount to add or remove. A positive number adds data from your pool. A negative number takes unused data back.
- Node.js
- Python
- cURL
Node.js
Request Parameters
Response
Response
Errors
Too much removed, or zero (400)
Too much removed, or zero (400)
An account’s data can’t go below zero, and you can only take back data that hasn’t been used. Lower the amount.
Proxy network rejected the change (502)
Proxy network rejected the change (502)
Nothing was charged or changed. You can safely retry.
Change Password
POST /reseller/users/:username/password
Sets a new password. Send the password you want, or an empty body to get a strong generated one. The username stays the same.
- Node.js
- Python
- cURL
Node.js
Request Parameters
Response
Response
The new password works within about 60 seconds. Until then the old password keeps working, and open connections are never cut. You can give your customer the new password right away.
Errors
Invalid password (400)
Invalid password (400)
The password doesn’t follow the rules above.
Change already in progress (409)
Change already in progress (409)
Another change to this sub-user is still running. Try again in a moment.
Proxy network rejected the change (502)
Proxy network rejected the change (502)
Nothing changed. You can safely retry.
Delete a Sub-User
DELETE /reseller/users/:username
Ends a customer’s access and returns their unused data to your pool.
- Node.js
- Python
- cURL
Node.js
Response
Response
What happens, in order:
- The account’s unused data is removed, so the credentials stop working.
- The unused data goes back to your unassigned pool.
- The sub-user is removed from your account. Its usage stays in your usage history.
Errors
Proxy network unreachable (502)
Proxy network unreachable (502)
The deletion stopped and nothing changed. The credentials still work and nothing was refunded. Try again later.
Errors on Every Endpoint
Sub-user not found (404)
Sub-user not found (404)
The message is
Sub-user "x" not found. Check the username. You can only see your own sub-users.Invalid or rotated key (401)
Invalid or rotated key (401)
See Authentication.
Limits
- Data per sub-user:
0.01to10000GB when you create it, changed by up to 10,000 GB per call. - Page size: at most 100 sub-users per list request.
- Password changes: take effect within about 60 seconds.
- Used data: can’t be refunded, by a data change or by a deletion.
Related
Proxy Access
How your customers connect with a sub-user’s credentials.
Usage History
Usage over time for your pool and for each sub-user.