# Usage

## POST /customer/usage/

> Get package usage data for sub-users

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Usage"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Usage":{"type":"object","properties":{"dateRange":{"type":"string","description":"Date range to search for package"},"planStatus":{"type":"number","description":"The plan status (1- active plans, 0- Inactive plans, 2- Standby plans, 3- All plans)"},"packageType":{"type":"number","description":"Package type (1 - dc, 2 - isp , 3 - res   )"},"bySubUser":{"type":"boolean","description":"Show the list with sub-users (For reseller only)"},"subUsers":{"type":"string","description":"Filter by specific sub-user (For reseller only)"}}},"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/usage/":{"post":{"tags":["Usage"],"summary":"Get package usage data for sub-users","operationId":"getDataUsage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}},"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/usage/myusage

> Get package usage data

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Usage"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"MyUsage":{"type":"object","properties":{"dateRange":{"type":"string","description":"Date range to search for package"},"planStatus":{"type":"number","description":"The plan status (1- active plans, 0- Inactive plans, 2- Standby plans, 3- All plans)"}}},"MyUsageSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"data":{"type":"array","description":"return object","items":{"$ref":"#/components/schemas/MyUsageSuccessObj"}}},"description":"MyUsage success response"},"MyUsageSuccessObj":{"type":"object","properties":{"id":{"type":"number","description":"Plan Id"},"start_date":{"type":"string","description":"start_date of the plan"},"end_date":{"type":"string","description":"end_date of the plan"},"is_active":{"type":"boolean","description":"plan status"},"total_requests_used":{"type":"number","description":"Total requests used"},"total_gb_used":{"type":"number","description":"Total gb used"},"usage_percentage":{"type":"string","description":"Show percentage value"},"plan_gb":{"type":"number","description":"Plan gb"},"product_type":{"type":"string","description":"Product Type"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/usage/myusage":{"post":{"tags":["Usage"],"summary":"Get package usage data","operationId":"myUsage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyUsage"}}},"required":false},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyUsageSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /customer/usage/{id}

> Get package usage data for sub-user

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Usage"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UsageByIdSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"data":{"type":"array","description":"The customer_id of the user","items":{"type":"object"}}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/customer/usage/{id}":{"get":{"tags":["Usage"],"summary":"Get package usage data for sub-user","operationId":"getUsageById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Array of Plans","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageByIdSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.netnut.io/netnut-documentation/resources/customers-api/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
