> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Credit Usage Alerts API

> Create, list, retrieve, update, and delete credit usage alerts that email you when daily sending credit usage passes a configured percentage.

Credit usage alerts send an email when daily sending credit usage passes a configured percentage.

## Authentication

**Base URL:** `https://pro.api.serversmtp.com/api/v2`

Send `consumerKey` and `consumerSecret` headers. The key needs **Statistics & Management APIs** (`APIS`) permission, and its IP restrictions must allow your server. See [authentication](/docs/api-reference/authentication.md).

## Create an alert

`POST /tools/alerts` requires an `email` and an integer `percentage` from `0` to `100`.

```bash Terminal theme={"system"}
curl -X POST 'https://pro.api.serversmtp.com/api/v2/tools/alerts' \
  -H 'consumerKey: YOUR_CONSUMER_KEY' \
  -H 'consumerSecret: YOUR_CONSUMER_SECRET' \
  -H 'Content-Type: application/json' \
  -d '{"email":"alerts@example.com","percentage":80}'
```

A successful creation returns `201` with the alert:

```json theme={"system"}
{
  "id": 4117,
  "percentage": 80,
  "email": "alerts@example.com"
}
```

## List and retrieve alerts

`GET /tools/alerts` returns `count` and `results`:

```bash Terminal theme={"system"}
curl 'https://pro.api.serversmtp.com/api/v2/tools/alerts' \
  -H 'consumerKey: YOUR_CONSUMER_KEY' \
  -H 'consumerSecret: YOUR_CONSUMER_SECRET'
```

```json theme={"system"}
{
  "count": 1,
  "results": [
    {"id":4117,"percentage":80,"email":"alerts@example.com"}
  ]
}
```

`GET /tools/alerts/{Id}` returns one alert object.

## Update an alert

Use `PATCH /tools/alerts/{Id}` with the destination email and percentage. The response is the updated alert object.

```bash Terminal theme={"system"}
curl -X PATCH 'https://pro.api.serversmtp.com/api/v2/tools/alerts/4117' \
  -H 'consumerKey: YOUR_CONSUMER_KEY' \
  -H 'consumerSecret: YOUR_CONSUMER_SECRET' \
  -H 'Content-Type: application/json' \
  -d '{"email":"alerts@example.com","percentage":90}'
```

## Delete an alert

```bash Terminal theme={"system"}
curl -X DELETE 'https://pro.api.serversmtp.com/api/v2/tools/alerts/4117' \
  -H 'consumerKey: YOUR_CONSUMER_KEY' \
  -H 'consumerSecret: YOUR_CONSUMER_SECRET'
```

`DELETE /tools/alerts/{Id}` returns `{"message":"success"}`. Get, update, and delete requests return `404` with `message: "alert_not_found"` when the ID does not exist.

Invalid percentages return `400`. Values above `100` produce `percentage_should_not_be_higher_than_100`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.