Billing — K8 HQ Content API
Billing operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
The organization's usage, charges, credit balance and payments, and mail held back for credit.
Base URL
| Base URL | For |
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
Billing
Get the credit balance
GET/billing/balance
The organization's credit: purchased, bonus (promotions and courtesy credit), usage charged or counted but not yet posted (it's posted once it reaches a cent, or after a day), and what's available after it. Negative means usage beyond credit. People signed in to the web app: the organization's owners and admins (?org=).
For API tokens with billing:read and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
available required | string | purchased + bonus - pending: moves with every request. Pattern: ^-?\d+(\.\d+)?$. |
bonus required | string | Promotional and courtesy credit. Pattern: ^-?\d+(\.\d+)?$. |
currency required | "USD" | |
pending required | string | Usage not yet posted to the balance: charged usage under a cent or less than a day old, and usage counted but not yet sent to billing (it goes a cent's worth or six hours at a time), priced now. Pattern: ^-?\d+(\.\d+)?$. |
purchased required | string | US dollars, exact (never a float). Pattern: ^-?\d+(\.\d+)?$. |
Responses
| Status | Body | Meaning |
| 200 | BillingBalance | The balance. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
List card payments
GET/billing/payments
The organization's card payments through Stripe (design note 0025), newest first, at most 50: when, the credit bought, tax, status (paid, refunded, partly_refunded, being_refunded, disputed, dispute_won, dispute_lost) and what was refunded. The card (brand and last 4) and Stripe's receipt link are given only on the caller's own payments (never to an API token). People signed in to the web app: the organization's owners and admins (?org=).
For API tokens with billing:read and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
payments required | object[] | |
Responses
| Status | Body | Meaning |
| 200 | BillingPayments | The payments. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Get the nonpayment standing
GET/billing/standing
Whether the organization is out of credit (design note 0024): out_of_credit from the day billing confirms its credit ran out (sending is refused and K8 is paused; mail still arrives) until credit is added; ok otherwise. The sendingPausedForCredit flag reports the sending gate's current credit check, including an organization that has never had credit, even while step is ok. Any member of the organization may read it, for the web app's banner; owed is given only to those who see its billing (the owners and admins, or a token with billing:read). People signed in to the web app: any member (?org=).
For API tokens with billing:read and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
comped required | boolean | K8 HQ gives this organization its credit: K8 HQ, not its owners, is told when it runs out, and adds more. |
sendingPausedForCredit required | boolean | Sending is paused for lack of credit right now: no credit balance exists, or available credit is at or below zero after pending usage and mail in flight, using the sending gate's check. Comped organizations follow the same credit rule. False while the credit gate is off. Every member gets this flag; it reveals no amount. |
step required | ok | out_of_credit | no_new_storage | held | readonly | The step enforced: ok; out_of_credit (day 0, from billing's confirmation: sending and K8 stop; mail still arrives); no_new_storage (day 7: mail apps can't add mail except drafts, new mail isn't indexed for search by meaning, no new domains or inboxes); held (day 30: new mail waits outside the inboxes, GET /held); readonly (day 60: nothing can be changed (writes get 402 read_only; reading and exports still work), new mail is turned away, and nothing more is charged). Back to ok when credit is back. |
deletionPending | boolean | K8 HQ has scheduled the organization's deletion because it has been out of credit for months (its last 7 days, read-only; owners can't cancel it). Only adding enough credit to bring the balance over zero stops it. Absent otherwise. |
holdUntil | string | While a card payment's dispute holds the timeline at out_of_credit (design note 0025): the date the hold ends unless the card company decides first (US Eastern). Sending and K8 are stopped; nothing else stops until then. |
nextAt | string | When nextStep takes effect (US Eastern): at the first daily check after the day before has ended. For deletion, early that day (06:00 UTC); once deletionPending, the date it's scheduled for. |
nextStep | no_new_storage | held | readonly | deletion | The next step, only once it's built and enabled, and never for a comped organization (it stays at out_of_credit). |
owed | string | While out of credit, and only for those who see the organization's billing: what it owes (credit under zero, less usage not yet posted), in US dollars and cents, rounded up. The next credit added pays it first. Pattern: ^\d+\.\d{2}$. |
stepSince | string | When the step enforced began (US Eastern), for steps after out_of_credit: absent when its start isn't recorded (a step set by hand) or the step is held back by the enabled maximum. |
zeroSince | string | When billing confirmed the credit ran out (day 0), while out of credit. |
Responses
| Status | Body | Meaning |
| 200 | BillingStanding | The standing. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Get usage and charges
GET/billing/usage
The organization's usage and what it was charged, by meter, hourly (up to 31 days) or daily (up to 366 days), to see what costs what and how it changes over time. Hourly totals cover sent mail (email.out.*) and K8 (k8.*) only: every other meter is counted and totalled daily, so hourly reports leave it out (since 2026-10-15). Amounts are exact decimal US dollars. Totals start from when billing reports were introduced. With by=member, by=token or by=inbox (daily only), each row also names who caused it: the member (mem_), the token (tok_; usage from the web app has none), or the inbox for usage nobody caused (incoming mail); per sums each one's charges. Attribution starts with usage from 2026-10-12. People signed in to the web app: the organization's owners and admins (?org=).
For API tokens with billing:read and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
granularity (query) | hour | day | |
from (query) required | string | First period: 2026-10-11 (daily) or 2026-10-11T14 (hourly), UTC. |
to (query) required | string | Last period, inclusive. |
meters (query) | string | Comma-separated meters to include (default all). |
by (query) | member | token | inbox | Totals per member, token or inbox instead of for the whole organization (granularity day). |
Response body (JSON)
| Field | Type | Description |
amount required | string | US dollars, exact (never a float). Pattern: ^-?\d+(\.\d+)?$. |
currency required | "USD" | |
from required | string | |
granularity required | hour | day | |
rows required | object[] | |
to required | string | |
totals required | object | Per meter over the whole range. |
by | member | token | inbox | Present when asked for: rows are per member, token or inbox. |
per | object | With by: each member, token or inbox's charges over the range (US dollars, exact). |
Responses
| Status | Body | Meaning |
| 200 | BillingUsage | Usage and charges. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Get the mail waiting for credit
GET/held
Mail held while the organization is out of credit (design note 0024: from day 30, new mail waits outside the inboxes until credit is added), for the banner the web app shows: how many messages are waiting. People who can see the organization's billing also get who sent them and when (never subjects), so an urgent sender can be spotted. Any member of the organization (?org=) or a token in it.
For API tokens and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
held required | integer | Messages waiting outside the inboxes. |
senders | object[] | Who sent the waiting mail and when, newest first, at most 100 (billing viewers only). |
Responses
| Status | Body | Meaning |
| 200 | HeldMail | The waiting mail. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Read current prices
GET/pricing
Public K8 HQ prices and a model for browser estimates. No sign-in is needed. Available at https://api.k8hq.com/pricing (also /v1/pricing). Prices come from the current billing rate card. The model uses a 30-day month, 50 KB sent emails with one recipient, and one connection open for 24 hours with 20 MB downloaded per mail-app day. Content, record and activity storage have separate quantities. Read assumptions before using the model; these examples are estimates, not a quote. CDN and browser caches may keep this response for five minutes. Cross-origin reads are allowed from https://k8hq.com and https://www.k8hq.com without credentials.
No sign-in needed.
Response body (JSON)
| Field | Type | Description |
assumptions required | string[] | |
currency required | "USD" | |
domainFeeOptions required | object[] | |
meters required | object | Customer meter prices only, including free form visits and refused or held responses. |
rateVersion required | string | Public version of the K8 HQ price list. |
typicalUsage required | object | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Current prices, domain plans and usage assumptions. |