Other endpoints
Get API quota
Get your API quota, how many requests you have remaining and when the limit resets. Note this request does not count towards your quota.
GET https://api.mailersend.com/v1/api-quota
use MailerSend\MailerSend;
$mailersend = new MailerSend();
$mailersend->apiQuota->get();
import 'dotenv/config';
import { MailerSend } from "mailersend";
const mailerSend = new MailerSend({
apiKey: process.env.API_KEY,
});
mailerSend.apiQuota.get()
.then((response) => console.log(response.body))
.catch((error) => console.log(error.body));
from mailersend import MailerSendClient
ms = MailerSendClient()
response = ms.api_quota.get_quota()
package main
import (
"context"
"log"
"time"
"github.com/mailersend/mailersend-go"
)
var APIKey = "Api Key Here"
func main() {
// Create an instance of the mailersend client
ms := mailersend.NewMailersend(APIKey)
ctx := context.Background()
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
_, _, err := ms.ApiQuota.Get(ctx)
if err != nil {
log.Fatal(err)
}
}
import com.mailersend.sdk.MailerSend;
import com.mailersend.sdk.apiquota.ApiQuota;
import com.mailersend.sdk.exceptions.MailerSendException;
public void GetApiQuota() {
MailerSend ms = new MailerSend();
ms.setToken("api token");
try {
ApiQuota quota = ms.apiQuota().getQuota();
System.out.println("Quota: " + quota.quota);
System.out.println("Remaining: " + quota.remaining);
System.out.println("Reset: " + quota.reset);
} catch (MailerSendException e) {
e.printStackTrace();
}
}
require "mailersend-ruby"
ms_api_quota = Mailersend::ApiQuota.new
ms_api_quota.get
Responses
Valid
{
"quota": 1000,
"remaining": 752,
"reset": "2023-04-15T00:00:00Z"
}
Error
Response Code: 401 Unathorized
See - Validation errors