# API For User-Pass

## List sub-users

> Returns a paginated list of sub-users for the authenticated account, with support for keyword search by user\_name, as well as sorting and ordering.

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"servers":[{"url":"https://sandbox.9proxy.com"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"api-key","in":"query"}},"schemas":{"ResponseListSubUser":{"type":"object","description":"Sub-users list response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Paginated response data.","properties":{"items":{"type":"array","description":"List of sub-users.","items":{"$ref":"#/components/schemas/SubUser"}},"total_items":{"type":"integer","description":"Total number of items."},"total_pages":{"type":"integer","description":"Total number of pages."}}}}},"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}},"ResponseBadRequestError":{"type":"object","description":"Response payload returned when the request is invalid.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}},"ResponseForbiddenError":{"type":"object","description":"Response payload returned when access is forbidden.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}}}},"paths":{"/client/v1/user-passes/get-list":{"get":{"summary":"List sub-users","description":"Returns a paginated list of sub-users for the authenticated account, with support for keyword search by user_name, as well as sorting and ordering.","parameters":[{"schema":{"type":"integer"},"name":"limit","in":"query","required":false,"description":"Maximum number of items to return per page. Default: 30"},{"schema":{"type":"integer"},"name":"page","in":"query","required":false,"description":"Requested page number (1-based). Default: 1"},{"schema":{"type":"string"},"name":"sort_by","in":"query","required":false,"description":"Field to sort by: 'id', 'user_name', 'status', 'created_at', 'use_key', 'usage_cap', 'data_used', 'ip_usage_cap', 'ip_used'. Default: id"},{"schema":{"type":"string"},"name":"order_by","in":"query","required":false,"description":"Sort order: desc or asc. Default: desc"},{"schema":{"type":"string"},"name":"keyword","in":"query","required":false,"description":"Keyword to search within the user_name field."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseListSubUser"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBadRequestError"}}}},"403":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseForbiddenError"}}}}}}}}}
```

## Create sub-user

> Creates a new sub-user (User-Pass credentials) and optionally applies traffic and IP usage limits.

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"servers":[{"url":"https://sandbox.9proxy.com"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"api-key","in":"query"}},"schemas":{"ResponseGenerateSubUser":{"type":"object","description":"Sub-user creation response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Created sub-user details.","$ref":"#/components/schemas/SubUser"}}},"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}},"ResponseBadRequestError":{"type":"object","description":"Response payload returned when the request is invalid.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}},"ResponseForbiddenError":{"type":"object","description":"Response payload returned when access is forbidden.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}}}},"paths":{"/client/v1/user-passes/create":{"post":{"summary":"Create sub-user","description":"Creates a new sub-user (User-Pass credentials) and optionally applies traffic and IP usage limits.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseGenerateSubUser"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBadRequestError"}}}},"403":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseForbiddenError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Sub-user password."},"status":{"type":"integer","description":"Sub-user status. 1: active, 2: disable"},"note":{"type":"string","description":"Optional note for internal tracking."},"usage_cap":{"type":"integer","description":"Traffic usage cap in bytes."},"ip_usage_cap":{"type":"integer","description":"IP usage cap (-1 for unlimited)."}},"required":["user_name","use_key","status"]}}}}}}}}
```

## Update sub-user

> Updates an existing sub-user by ID, including password, status, note, and optional traffic/IP usage caps.

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"servers":[{"url":"https://sandbox.9proxy.com"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"api-key","in":"query"}},"schemas":{"ResponseUpdateSubUser":{"type":"object","description":"Sub-user update response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Updated sub-user details.","$ref":"#/components/schemas/SubUser"}}},"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}},"ResponseBadRequestError":{"type":"object","description":"Response payload returned when the request is invalid.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}},"ResponseForbiddenError":{"type":"object","description":"Response payload returned when access is forbidden.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}}}},"paths":{"/client/v1/user-passes/update":{"put":{"summary":"Update sub-user","description":"Updates an existing sub-user by ID, including password, status, note, and optional traffic/IP usage caps.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseUpdateSubUser"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBadRequestError"}}}},"403":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseForbiddenError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Sub-user ID to update."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Sub-user password."},"status":{"type":"integer","description":"Sub-user status. 1: active, 2: disable"},"note":{"type":"string","description":"Optional note for internal tracking."},"usage_cap":{"type":"integer","description":"Traffic usage cap in bytes."},"ip_usage_cap":{"type":"integer","description":"IP usage cap (-1 for unlimited)."}},"required":["id","use_key","status"]}}}}}}}}
```

## Delete sub-user

> Deletes a sub-user by ID.

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"servers":[{"url":"https://sandbox.9proxy.com"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"api-key","in":"query"}},"schemas":{"ResponseDeleteSubUser":{"type":"object","description":"Sub-user deletion response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Deletion result.","properties":{"deleted":{"type":"boolean"}}}}},"ResponseBadRequestError":{"type":"object","description":"Response payload returned when the request is invalid.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}},"ResponseForbiddenError":{"type":"object","description":"Response payload returned when access is forbidden.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}}}},"paths":{"/client/v1/user-passes/delete":{"delete":{"summary":"Delete sub-user","description":"Deletes a sub-user by ID.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDeleteSubUser"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBadRequestError"}}}},"403":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseForbiddenError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Sub-user ID to delete."}},"required":["id"]}}}}}}}}
```

## The SubUser object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}}}}}
```

## The ResponseListSubUser object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"ResponseListSubUser":{"type":"object","description":"Sub-users list response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Paginated response data.","properties":{"items":{"type":"array","description":"List of sub-users.","items":{"$ref":"#/components/schemas/SubUser"}},"total_items":{"type":"integer","description":"Total number of items."},"total_pages":{"type":"integer","description":"Total number of pages."}}}}},"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}}}}}
```

## The ResponseGenerateSubUser object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"ResponseGenerateSubUser":{"type":"object","description":"Sub-user creation response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Created sub-user details.","$ref":"#/components/schemas/SubUser"}}},"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}}}}}
```

## The ResponseUpdateSubUser object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"ResponseUpdateSubUser":{"type":"object","description":"Sub-user update response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Updated sub-user details.","$ref":"#/components/schemas/SubUser"}}},"SubUser":{"type":"object","description":"Sub-user account configuration and usage metrics.","properties":{"id":{"type":"integer","description":"Sub-user ID."},"user_name":{"type":"string","description":"Sub-user username."},"use_key":{"type":"string","description":"Password used with user_name for authentication."},"usage_cap":{"type":"integer","description":"Traffic usage cap for the sub-user (bytes)."},"ip_usage_cap":{"type":"integer","description":"IP usage cap for the sub-user."},"data_used":{"type":"integer","description":"Total traffic consumed by the sub-user."},"ip_used":{"type":"integer","description":"Total number of IPs consumed by the sub-user."},"status":{"type":"integer","description":"1: Active, 2: Disabled, 3: Blocked"},"note":{"type":"string","description":"Optional note associated with the sub-user."},"created_at":{"type":"integer","description":"Sub-user creation timestamp."},"updated_at":{"type":"integer","description":"Sub-user last updated timestamp."}}}}}}
```

## The ResponseDeleteSubUser object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"ResponseDeleteSubUser":{"type":"object","description":"Sub-user deletion response payload.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"result":{"type":"object","description":"Deletion result.","properties":{"deleted":{"type":"boolean"}}}}}}}}
```

## The ResponseForbiddenError object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"ResponseForbiddenError":{"type":"object","description":"Response payload returned when access is forbidden.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}}}}}
```

## The ResponseBadRequestError object

```json
{"openapi":"3.1.1","info":{"title":"Sub user","version":"1.0"},"components":{"schemas":{"ResponseBadRequestError":{"type":"object","description":"Response payload returned when the request is invalid.","properties":{"success":{"type":"boolean","description":"Indicates whether the request was successful."},"message":{"type":"string","description":"Human-readable response message."},"errors":{"type":"array","description":"List of error messages.","items":{"type":"string"}}}}}}}
```
