client.Limits
Every method in this namespace: its signature, its parameters, what it returns and an example.
Methods
The daily and monthly sends of this workspace and its plan, how many it has used and when each count starts again, and the API requests a minute it may make.
Limits.GetAsync
Read the limits of the workspace
Task<JsonObject> GetAsync(string? apiKey = null, CancellationToken cancellationToken = default)Returns the plan of the workspace, the emails it has sent today and this month with the limit of each and when it resets, and the API requests a minute it may make.
Emails are counted as recipients. On the free plan the count covers every free workspace of the owner together. A limit is null when nothing caps it, which is the daily limit of a paid plan. resetsAt is the next midnight in UTC for the day and the first instant of the next month in UTC for the month. A send that would take the workspace past either limit is a 429 send_quota_exceeded. The count is read before the send, so two sends at the same moment can both pass and go over by what the second one carries. apiRequestsPerMinute counts every API key and app of the workspace together.
Parameters
apiKeystring?Overrides the client's API key for this call only.
cancellationTokenCancellationTokenCancels the request.
Returns
A JsonObject with object set to limits, plan (an object with id and name), sends (an object with day and month, each an object with limit, used and resetsAt) and apiRequestsPerMinute.
Example
var limits = await client.Limits.GetAsync(); Console.WriteLine($"{limits["sends"]?["day"]?["used"]} sends today");Console.WriteLine($"{limits["sends"]?["month"]?["used"]} sends this month");Console.WriteLine($"{limits["apiRequestsPerMinute"]} API requests a minute");Also available in
- API
GET /limits- TypeScript
limits.get()- Python
limits.get()- Ruby
limits.get- PHP
limits->get- Go
Limits.Get- Java
limits().get- CLI
nextmail limits get