> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.iot.telia.lt/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.iot.telia.lt/_mcp/server.

# Retrieve data quota details

GET https://iot.telia.lt/api/v1/endpoint/{endpoint_id}/quota/data

Returns details about the assigned Data Quota for an endpoint.
* `status`: this indicates the current status of the quota and may contain the following values:
    - `ACTIVE`: the endpoint can currently connect and has quota left
    - `EXHAUSTED`: the endpoint has exceeded the quota volume, if it still can use data service depends on the action chosen to be performed on exhaustion
    - `EXPIRED`: the quota has expired; the endpoint is denied from using data services (until new quota is added)
* `volume`: returns the volume left on this quota in MB
* `expiry_date`: timestamp when this quota will expire and the endpoint will definitely be denied from using further data services (regardless if the quota volume was used up or not)
* `action_on_exhaustion`: returns the behaviour defined to be applied when quota volume is used up (exhausted).
    - `Throttle`: bandwidth will be throttle to the defined peak throughput until quota expires
    - `Block`: data service will be instantly blocked once volume used up, regardless if the expiry date is already reached or not
* `auto_refill`: 0 (false) / 1 (true), refill the quota with the last added volume on a daily basis


Reference: https://docs.iot.telia.lt/developers/api/endpoint/endpoint-quota-data-by-endpoint-id-get

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Path parameters

- `endpoint_id` (integer, required) — Numeric ID of an endpoint

## Response

### 200

Success

- `status` (ApiV1EndpointEndpointIdQuotaDataGetResponsesContentApplicationJsonSchemaStatus, required)
- `volume` (float, required)
- `expiry_date` (string, required)
- `action_on_exhaustion` (ApiV1EndpointEndpointIdQuotaDataGetResponsesContentApplicationJsonSchemaActionOnExhaustion, required)
- `last_volume_added` (float, optional)
- `last_status_change_date` (string, optional)
- `auto_refill` (integer, optional)
- `threshold_volume` (float, optional)
- `threshold_percentage` (float, optional)

## Errors

### 403 Forbidden Error

Your role doesn't include the permission this endpoint requires. Most endpoints return `error_code`, `error_token`, and `message`. Some return only `status_code` and `message`.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `status_code` (integer, optional)
- `message` (string, optional)

## Types

### ApiV1EndpointEndpointIdQuotaDataGetResponsesContentApplicationJsonSchemaStatus

- `id` (enum, required)
  - Allowed values: `1`, `2`, `3`
- `description` (enum, optional)
  - Allowed values: `EXHAUSTED`, `ACTIVE`, `EXPIRED`

### ApiV1EndpointEndpointIdQuotaDataGetResponsesContentApplicationJsonSchemaActionOnExhaustion

- `id` (enum, required)
  - Allowed values: `1`
- `description` (enum, optional)
  - Allowed values: `Block`

## Examples

**Response**

```json
{
  "status": {
    "id": 1,
    "description": "ACTIVE"
  },
  "volume": 99.999228,
  "expiry_date": "2020-01-17T08:47:00.000Z",
  "action_on_exhaustion": {
    "id": 1,
    "description": "Block",
    "action_on_quota_exhaustion_id": "1"
  },
  "last_volume_added": 100,
  "last_status_change_date": "2019-04-10 14:22:11",
  "auto_refill": 0,
  "threshold_volume": 15,
  "threshold_percentage": 15
}
```

**SDK Code**

```python
import requests

url = "https://iot.telia.lt/api/v1/endpoint/1/quota/data"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://iot.telia.lt/api/v1/endpoint/1/quota/data';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/1/quota/data"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/1/quota/data")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/1/quota/data")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/1/quota/data', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/1/quota/data");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/1/quota/data")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```