# Sub users

(For resellers only)

## GET /customer/sub-user/{id}

> Get sub-user by ID

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SubUsersSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"data":{"type":"array","description":"Data of sub users","items":{"type":"object"}}},"description":"SubUsers"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/{id}":{"get":{"tags":["Sub users"],"summary":"Get sub-user by ID","operationId":"getById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Data of the sub users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubUsersSuccess"}}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PATCH /customer/sub-user/{id}/password

> Set sub-user proxy password

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdatePasswordProps":{"required":["new_login_pwd"],"type":"object","properties":{"new_login_pwd":{"type":"string","description":"new_login_pwd"}}},"UpdatePasswordSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"data":{"type":"array","description":"Data of sub users","items":{"type":"object"}}},"description":"Update Password"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/{id}/password":{"patch":{"tags":["Sub users"],"summary":"Set sub-user proxy password","operationId":"patchSubUserPassword","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePasswordProps"}}},"required":false},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePasswordSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /customer/sub-user/

> Get sub-users

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SubUsersSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"data":{"type":"array","description":"Data of sub users","items":{"type":"object"}}},"description":"SubUsers"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/":{"get":{"tags":["Sub users"],"summary":"Get sub-users","operationId":"getSubUsers","parameters":[{"name":"is_active","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Data of the sub users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubUsersSuccess"}}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /customer/sub-user/

> Create sub-user

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SubUser":{"required":["customer_dashboard_email","customer_dashboard_pwd","customer_login_name","customer_login_pwd","customer_name"],"type":"object","properties":{"customer_dashboard_email":{"type":"string","description":"customer_dashboard_email"},"customer_name":{"type":"string","description":"customer_name"},"customer_dashboard_pwd":{"type":"string","description":"customer_dashboard_pwd"},"customer_login_name":{"type":"string","description":"customer_login_name"},"customer_login_pwd":{"type":"string","description":"customer_login_pwd"},"snkrs_private_pool":{"type":"number","description":"snkrs_private_pool"}}},"PostSubUser":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"data":{"type":"array","description":"Data of sub users","items":{"type":"object"}}},"description":"SubUsers"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/":{"post":{"tags":["Sub users"],"summary":"Create sub-user","operationId":"postSubUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubUser"}}},"required":false},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostSubUser"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /customer/sub-user/{id}/allocate

> Allocate GB to sub-user

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Allocate":{"required":["allocate"],"type":"object","properties":{"allocate":{"type":"number","description":"allocate gb"},"product_type":{"type":"string","description":"Product type (Options: '*', 'dc', 'res', 'stc', 'mob')"}}},"LoginSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"token":{"type":"string","description":"token"}},"description":"Login credentials"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/{id}/allocate":{"post":{"tags":["Sub users"],"summary":"Allocate GB to sub-user","operationId":"allocate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Allocate"}}},"required":false},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /customer/sub-user/{id}/allocateIps

> Allocate IPs to sub-user

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AllocateIps":{"required":["access_point","bandwidth","country_code","ips"],"type":"object","properties":{"access_point":{"type":"string","description":"Access Point"},"country_code":{"type":"string","description":"Country Code"},"ips":{"type":"number","description":"IP's to allocate"},"bandwidth":{"type":"number","description":"bandwith you want to give to sub-user"}}},"AllocateIpsSuccess":{"required":["message","success"],"type":"object","properties":{"success":{"type":"boolean","description":"success flag"},"message":{"type":"string","description":"message"}},"description":"allocateIps success response"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/{id}/allocateIps":{"post":{"tags":["Sub users"],"summary":"Allocate IPs to sub-user","operationId":"allocateIps","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocateIps"}}},"required":false},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocateIpsSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /customer/sub-user/{id}/disabled

> Disable sub-user

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Sub users","description":"(For resellers only)"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdateSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}},"description":"success update"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/sub-user/{id}/disabled":{"put":{"tags":["Sub users"],"summary":"Disable sub-user","operationId":"disabled","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
