> 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.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

# Show SMS quota details

GET https://cdn.emnify.net/api/v1/endpoint/{endpoint_id}/quota/sms

Required permissions Beta [Learn more](/developers/api-guidelines/permissions#how-permissions-work)`Endpoint.Quota.Sms` + `Get`Roles: Administrator User ObserverReturns the SMS quota of an endpoint, including its status and the number of SMS remaining.

Reference: https://docs.emnify.com/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

- `status` (EndpointQuotaStatus, required) — Current status of the quota.
- `volume` (float, required) — Remaining volume, in MB for a data quota or as a number of SMS for an SMS quota.
- `expiry_date` (string, required) — When the quota expires, as `YYYY-MM-DD HH:MM:SS` in UTC. After this time, a device with a data quota can't use data services, even if volume remains.
- `action_on_exhaustion` (EndpointQuotaActionOnExhaustion, required) — What happens when the quota volume runs out.
- `last_volume_added` (float, optional) — Volume from the most recent request that set the quota.
- `last_status_change_date` (string, optional, nullable) — When the quota was last set or its status last changed, as `YYYY-MM-DD HH:MM:SS` in UTC.
- `auto_refill` (enum, optional) — Whether the quota refills daily with the last added volume. `0` means disabled and `1` means enabled.
  - Allowed values: `0`, `1`
- `threshold_percentage` (integer, optional) — Percentage of the volume below which the system generates a threshold event.
- `threshold_volume` (float, optional) — Remaining volume at which the system generates a threshold event, calculated from `volume` and `threshold_percentage` when a request sets `threshold_percentage`.

## Errors

### 400 Bad Request Error

The `endpoint_id` isn't an integer.

- `status_code` (integer, required) — HTTP status code.
- `message` (string, required) — Error message.

### 401 Unauthorized Error

The request has no valid authentication token.

- `message` (string, required) — Error message.

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

### 404 Not Found Error

The endpoint has no SMS quota.

- `status_code` (integer, required) — HTTP status code.
- `message` (string, required) — Error message.

### 422 Unprocessable Entity Error

The endpoint doesn't exist or isn't part of your organization.

- `status_code` (integer, required) — HTTP status code.
- `message` (string, required) — Error message.

## Types

### EndpointQuotaStatus

Current status of the quota.

- `id` (enum, required) — ID of the quota status: - `1` (`ACTIVE`): the quota has volume left and hasn't expired. - `2` (`EXHAUSTED`): the volume is used up. - `3` (`EXPIRED`): the expiry date of a data quota has passed.
  - Allowed values: `1`, `2`, `3`
- `description` (enum, required) — Name of the quota status.
  - Allowed values: `ACTIVE`, `EXHAUSTED`, `EXPIRED`

### EndpointQuotaActionOnExhaustion

What happens when the quota volume runs out.

- `id` (enum, required) — ID of the action on quota exhaustion. `1` blocks the device from using the service.
  - Allowed values: `1`
- `description` (enum, required) — Name of the action on quota exhaustion.
  - Allowed values: `Block`

## Examples

**Response**

```json
{
  "status": {
    "id": 2,
    "description": "EXHAUSTED"
  },
  "volume": 0,
  "expiry_date": "2030-01-17 08:47:00",
  "action_on_exhaustion": {
    "id": 1,
    "description": "Block"
  },
  "last_volume_added": 1,
  "last_status_change_date": "2026-01-18 09:05:42",
  "auto_refill": 0,
  "threshold_percentage": 20,
  "threshold_volume": 0.2
}
```

**SDK Code**

```python Exhausted SMS Quota
import requests

url = "https://cdn.emnify.net/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://cdn.emnify.net/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://cdn.emnify.net/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://cdn.emnify.net/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://cdn.emnify.net/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://cdn.emnify.net/api/v1/endpoint/1/quota/sms', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Exhausted SMS Quota
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/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://cdn.emnify.net/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()
```