> 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.

# Show SMS quota details

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

Returns details about the assigned SMS Quota for an endpoint.

You can retrieve the current SMS quota status for an endpoint with the following API call. It will return following properties:
* `status`: this indicates the status of the quota and may contain the following values:
  - `ACTIVE`: the endpoint has quota left and can use SMS services
  - `EXHAUSTED`: the endpoint has exceeded the quota volume; the endpoint is denied from using SMS services (until new quota is added)
  - `EXPIRED`: the quota has expired; the endpoint is denied from using SMS services (until new quota is added)
* `volume`: the amount of SMS left on this quota
* `expiry_date`: timestamp when this quota will expire and the endpoint will definitely be denied from using further SMS services (regardless if the quota volume was used up or not)
* `threshold_percentage`: optional threshold in percentage indicating when a "Threshold Reached" event shall be sent.
* `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-sms-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

- `any`

## 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)

## Examples

**Response**

```json
{
  "action_on_exhaustion": {
    "action_on_quota_exhaustion_id": "1",
    "description": "Block",
    "id": 1
  },
  "auto_refill": 0,
  "expiry_date": "2022-01-17T08:47:00.000Z",
  "last_status_change_date": null,
  "last_volume_added": 1,
  "status": {
    "description": "EXHAUSTED",
    "id": 2
  },
  "threshold_percentage": 20,
  "threshold_volume": 0.2,
  "volume": 0
}
```

**SDK Code**

```python Exhausted SMS Quota
import requests

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

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

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

print(response.json())
```

```javascript Exhausted SMS Quota
const url = 'https://iot.telia.lt/api/v1/endpoint/1/quota/sms';
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 Exhausted SMS Quota
package main

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

func main() {

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

	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 Exhausted SMS Quota
require 'uri'
require 'net/http'

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

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 Exhausted SMS Quota
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/sms")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Exhausted SMS Quota
using RestSharp;

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

```swift Exhausted SMS Quota
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/1/quota/sms")! 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()
```