/API

Usage

The Usage API allows you to view your account limits, as well as list usage history to better understand how your Mailosaur account is utilized.

Retrieve account limits

Retrieve account usage limits. Details the current limits and usage for your account. This endpoint requires authentication with an account-level API key.

Postman iconInsomnia icon
GET /api/usage/limits
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/usage/limits
const limits = await mailosaur.usage.limits();
cy.mailosaurGetSpamAnalysis().then(limits => {
  cy.log(limits)
})
limits = mailosaur.usage.limits()
UsageAccountLimits limits = mailosaur.usage().limits();
var limits = mailosaur.Usage.Limits();
limits = mailosaur.usage.limits()
$limits = $mailosaur->usage->limits();
limits, _ := m.Usage.Limits()
{
  "servers": {
    "current": 27,
    "limit": 50
  },
  "users": {
    "current": 16,
    "limit": 25
  },
  "email": {
    "current": 12356,
    "limit": 20000
  },
  "sms": {
    "current": 271,
    "limit": 500
  },
  "previews": {
    "current": 89,
    "limit": 200
  },
  "numbers": {
    "current": 2,
    "limit": 5
  }
}

List usage transactions

Retrieves the last 31 days of transactional usage. This endpoint requires authentication with an account-level API key.

Postman iconInsomnia icon
GET /api/usage/transactions
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/usage/transactions
const limits = await mailosaur.usage.transactions();
cy.mailosaurGetSpamAnalysis().then(transactions => {
  cy.log(transactions)
})
limits = mailosaur.usage.transactions()
UsageTransactionListResult limits = mailosaur.usage().transactions();
var limits = mailosaur.Usage.Transactions();
limits = mailosaur.usage.transactions()
$limits = $mailosaur->usage->transactions();
limits, _ := m.Usage.Transactions()
{
  "items": [
    {
      "timestamp": "2021-01-31T00:00:00Z",
      "email": 2000,
      "sms": 51,
      "previews": 0
    }
  ]
}