List the credits a site spent on email
list_site_email_credits
Lists the AI credits a site's email used, newest first and 20 to a page, with every block of extra emails it bought and every refund.
A charge is a block of 2,000 extra emails the site bought once its monthly allowance ran out. Pass period, or from and to for a custom range, the same way as for get_site_email_stats, to narrow it to a window, or leave all three out for every entry.
Each item carries its id, its type (deduction for a charge, or refund), the credits, the number of emails it covered (quantity) and when it happened (createdAt). hasMore says whether to ask again with offset set to the offset the answer returns. See Credits spent on email.
Request
Call it with a POST to https://api.modulify.ai/v1/list_site_email_credits, sending the inputs below as a JSON object. The token needs the config:read scope.
It only reads and changes nothing, so retrying it is safe.
curl -X POST https://api.modulify.ai/v1/list_site_email_credits \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID"}'Over MCP, the same method is the list_site_email_credits tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
period |
string | No | One of day, 24h, 7d, 30d, 90d, 12mo or all. day is today so far, from midnight UTC, 24h is the current hour and the 23 before it, 7d, 30d and 90d are the last 7, 30 and 90 days counting today, 12mo is this month and the 11 before it, and all reaches back to the first record. Leave it out when you send from and to. |
from |
string | No | The first day of a custom range as YYYY-MM-DD in UTC, sent together with to. |
to |
string | No | The last day of a custom range as YYYY-MM-DD in UTC, included in the range and sent together with from. |
type |
string | No | Which entries to keep: all, charges or refunds. Defaults to all. |
offset |
number | No | Where the page starts, from the offset of the previous answer. Leave it out for the first page. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.