> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eclipseproxy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create subuser

> POST /api/reseller/v1/subusers: create a subuser and allocate bandwidth

Create a new subuser and allocate bandwidth from your pool. A secure password is generated and returned once in the response.

## Authentication

Requires a reseller API key. Pass it as `Authorization: Bearer YOUR_API_KEY` or `X-API-Key: YOUR_API_KEY`. See [Reseller overview](/api/reseller/overview#authentication).

## Body parameters

<ParamField body="username" type="string" required>
  Desired username. Automatically prefixed with your store code (e.g. `user1` becomes `MYSTORE_user1`).
</ParamField>

<ParamField body="email" type="string" required>
  Email for the subuser.
</ParamField>

<ParamField body="bandwidth" type="number" required>
  Bandwidth to allocate, in MB. Must be a positive number and cannot exceed your available balance.
</ParamField>

## Response

Returns the created subuser, including the generated `password`. Store it now: it isn't shown again.

## Example request

```json theme={"dark"}
{
  "username": "user1",
  "email": "user1@example.com",
  "bandwidth": 100
}
```

## Example response

```json theme={"dark"}
{
  "status": "success",
  "message": "Subuser created",
  "messageCode": "SUBUSER_CREATED",
  "data": {
    "id": "subuser-125",
    "username": "MYSTORE_user1",
    "email": "user1@example.com",
    "bandwidthBalance": 100,
    "createdAt": "2026-02-22T11:00:00Z",
    "whitelistIPs": [],
    "password": "GeneratedSecurePassword123!"
  }
}
```

## Errors

| Status | Code                   | Reason                                      |
| ------ | ---------------------- | ------------------------------------------- |
| 400    | `INSUFFICIENT_BALANCE` | Not enough bandwidth available              |
| 409    | `USERNAME_TAKEN`       | A subuser with that username already exists |
| 422    | `MISSING_FIELDS`       | A required field is missing                 |
| 422    | `INVALID_BANDWIDTH`    | Bandwidth must be a positive number         |
