Postilio docs

Usage

Postilio counts what you send per project and per calendar month in UTC. The month is the period your plan's monthly limit applies to, and the one that will be billed.

What counts

NumberMeaning
acceptedlive messages accepted, one per recipient
suppressedaccepted messages that were never sent, because the address is on the suppression list
billableaccepted minus suppressed: what is billed and what counts towards the monthly limit
delivered, bounced, complainedwhat happened in the month, counted on the moment it happened
receivedinbound mail the project received: one per message, also when it reached several of your routes. A message to receiving domains of two of your projects counts in each project, and once towards your organization's monthly limit. It counts towards the monthly limit like a sent message; mail held back by a route does not. null when your organization does not receive inbound mail

A bounce still counts as billable: the message was sent. Messages sent with a test key (pk_test_…) never count. A message accepted on the last evening of a month counts in that month, even when it is delivered after midnight. A scheduled message counts when it goes out, not when you scheduled it; one that is canceled never counts.

A month is closed a day after it ends. From then on its numbers never change (final is true), not even when a project is deleted or moved to another organization. Usage before a project moved stays with the organization it was billed to.

Read the usage of a project

GET /v1/usage needs a live key with the usage:read scope. That scope is never on by default: add it to a key that reads usage, such as one for your own dashboard or billing script. The key sees its own project only.

curl "https://api.postilio.eu/v1/usage?month=2026-10" \
  -H "Authorization: Bearer $POSTILIO_KEY"
{
  "month": "2026-10",
  "final": false,
  "resetsAt": "2026-11-01T00:00:00+00:00",
  "organization": { "plan": "growth", "state": "warning" },
  "project": {
    "id": "0199b3c0-6f3a-7d2e-9a41-2c8e5d7f1a20",
    "billable": 12040, "accepted": 12101, "suppressed": 61,
    "delivered": 11950, "bounced": 88, "complained": 2, "received": null
  },
  "apiKey": {
    "id": "0199b3c4-2b71-7c05-8e6d-5a9f3c1e7b42",
    "accepted": 8020, "sent": 7981, "suppressed": 39,
    "delivered": 7915, "bounced": 64, "complained": 2
  }
}

month is yyyy-MM; without it you get the current month. A month without usage answers with zeros. A month in the future, before 2020 or in another format answers 400 with the problem in errors.month.

organization tells where your organization as a whole stands against the monthly limit of its plan, without its numbers or those of its other projects:

stateMeaning
okbelow 80% of the monthly limit, or no limit
warningfrom 80%
overfrom 100%, on a plan with overage
cappedat the point where sending stops: 100% on a plan without overage, the overage cap on one with it
nullthe month asked for is not the current one

plan is the code of the plan the organization has now. resetsAt is the start of the next month, when the limit starts over.

apiKey is the key making the call, and only that key: never the project's other keys. A key moved from another project counts here from the move on; what it sent before stays with that project. Its numbers are informative; the project's are the ones that are billed. They count differently from project:

NumberMeaning
acceptedmessages this key had accepted in the month, over the API and over SMTP
sentaccepted minus suppressed
suppressedaccepted but never sent, because the address is on the suppression list
delivered, bounced, complainedthe status those messages have now, counted on the day they were accepted

A message accepted on 31 October that bounces on 1 November is a bounce of October here. A complaint after delivery counts as complained, not as delivered. The numbers per key are kept for the current month and the twelve before it; older months answer with zeros.

In Node

// This month's usage of the key's project: node usage.mjs (Node 18 or later, no packages needed).
const response = await fetch('https://api.postilio.eu/v1/usage', {
  headers: { Authorization: `Bearer ${process.env.POSTILIO_KEY}` },
});
const usage = await response.json();
if (!response.ok) {
  throw new Error(`Postilio answered ${response.status}: ${JSON.stringify(usage)}`);
}
console.log(`${usage.month}: ${usage.project.billable} billable, organization ${usage.organization.state}, this key sent ${usage.apiKey.sent}`);

In C#

// This month's usage of the key's project: dotnet run Usage.cs (.NET 10, no packages needed).
// A file-based app is compiled ahead of time, without reflection-based JSON; in a project, leave this line out.
#:property PublishAot=false
using System.Net.Http.Headers;
using System.Net.Http.Json;

using var http = new HttpClient { BaseAddress = new Uri("https://api.postilio.eu/") };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTILIO_KEY"));

var response = await http.GetAsync("v1/usage");
if (!response.IsSuccessStatusCode)
{
    throw new HttpRequestException($"Postilio answered {(int)response.StatusCode}: {await response.Content.ReadAsStringAsync()}");
}
var usage = await response.Content.ReadFromJsonAsync<Usage>();
Console.WriteLine($"{usage?.Month}: {usage?.Project.Billable} billable, organization {usage?.Organization.State}, this key sent {usage?.ApiKey.Sent}");

record Usage(string Month, bool Final, DateTimeOffset ResetsAt, UsageOrganization Organization, ProjectUsage Project, KeyUsage ApiKey);
record UsageOrganization(string? Plan, string? State);
record ProjectUsage(Guid Id, long Billable, long Accepted, long Suppressed, long Delivered, long Bounced, long Complained);
record KeyUsage(Guid Id, long Accepted, long Sent, long Suppressed, long Delivered, long Bounced, long Complained);

Errors

StatusBodyWhen
400validation problemmonth is not a month from 2020 up to the current one, as yyyy-MM
401{"error": "invalid_api_key"}no key, or one that does not exist or was revoked
403{"error": "insufficient_scope"}the key lacks usage:read; a test key never has it

In the portal

Owners, Admins and Billing members see the whole organization under Usage & plan: this month against the plan's limit with a forecast at the current pace, every project, a chart per day and the twelve months before, with a CSV export per month. The numbers are the same as here.

The numbers per key are under Keys & SMTP, for the members who manage the project's keys: sent today, in 7 and 30 days and this month, suppressed, bounces and complaints, and a chart per day for each key. Revoked keys stay there while they have numbers.