K8 HQ

Billing — K8 HQ Content API

Billing operations for K8 HQ Content API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

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 URLFor
https://api.k8hq.com/v1API 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

NameTypeDescription
org (query)stringThe 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)

FieldTypeDescription
available requiredstringpurchased + bonus - pending: moves with every request. Pattern: ^-?\d+(\.\d+)?$.
bonus requiredstringPromotional and courtesy credit. Pattern: ^-?\d+(\.\d+)?$.
currency required"USD"
pending requiredstringUsage 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 requiredstringUS dollars, exact (never a float). Pattern: ^-?\d+(\.\d+)?$.

Responses

StatusBodyMeaning
200BillingBalanceThe balance.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
org (query)stringThe 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)

FieldTypeDescription
payments requiredobject[]

Responses

StatusBodyMeaning
200BillingPaymentsThe payments.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
org (query)stringThe 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)

FieldTypeDescription
comped requiredbooleanK8 HQ gives this organization its credit: K8 HQ, not its owners, is told when it runs out, and adds more.
sendingPausedForCredit requiredbooleanSending 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 requiredok | out_of_credit | no_new_storage | held | readonlyThe 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.
deletionPendingbooleanK8 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.
holdUntilstringWhile 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.
nextAtstringWhen 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.
nextStepno_new_storage | held | readonly | deletionThe next step, only once it's built and enabled, and never for a comped organization (it stays at out_of_credit).
owedstringWhile 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}$.
stepSincestringWhen 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.
zeroSincestringWhen billing confirmed the credit ran out (day 0), while out of credit.

Responses

StatusBodyMeaning
200BillingStandingThe standing.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
org (query)stringThe 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) requiredstringFirst period: 2026-10-11 (daily) or 2026-10-11T14 (hourly), UTC.
to (query) requiredstringLast period, inclusive.
meters (query)stringComma-separated meters to include (default all).
by (query)member | token | inboxTotals per member, token or inbox instead of for the whole organization (granularity day).

Response body (JSON)

FieldTypeDescription
amount requiredstringUS dollars, exact (never a float). Pattern: ^-?\d+(\.\d+)?$.
currency required"USD"
from requiredstring
granularity requiredhour | day
rows requiredobject[]
to requiredstring
totals requiredobjectPer meter over the whole range.
bymember | token | inboxPresent when asked for: rows are per member, token or inbox.
perobjectWith by: each member, token or inbox's charges over the range (US dollars, exact).

Responses

StatusBodyMeaning
200BillingUsageUsage and charges.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
org (query)stringThe 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)

FieldTypeDescription
held requiredintegerMessages waiting outside the inboxes.
sendersobject[]Who sent the waiting mail and when, newest first, at most 100 (billing viewers only).

Responses

StatusBodyMeaning
200HeldMailThe waiting mail.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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)

FieldTypeDescription
assumptions requiredstring[]
currency required"USD"
domainFeeOptions requiredobject[]
meters requiredobjectCustomer meter prices only, including free form visits and refused or held responses.
rateVersion requiredstringPublic version of the K8 HQ price list.
typicalUsage requiredobject

Responses

StatusBodyMeaning
200JSONCurrent prices, domain plans and usage assumptions.