K8 HQ

Health — K8 HQ Setup API

Health operations for K8 HQ Setup API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

Before making requests, read the authentication and request requirements.

Check a domain's mail health, and the moving checklist and monitors that go with it.

Base URL

Base URLFor
https://api.k8hq.com/setupThe K8 HQ web app, and programs acting with a person's session

Endpoints

Health

Confirm a sender sends the organization's mail

POST/v1/health/senders/confirm

Marks a sender from a verified domain's DMARC reports (one of the domain's Health senders, seen in the last 90 days) as one that sends the organization's mail: "This service sends our mail". Only Health's judgments change: the sender's mail, where the reports attribute it with a passing SPF or DKIM check for the sender's own domain, counts in the domain's own-mail pass rate, for the days already kept too. 404 sender_unknown for a sender the domain's reports haven't named in 90 days. Needs domains.manage.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).

Request body (JSON)

FieldTypeDescription
domain requiredstring
name requiredstringThe sender as Health names it: a known service (Mailchimp) or a domain (example-hosting.net).
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"domain":"example.com","name":"Mailchimp","orgId":"org_01JABCDEFGHJKMNPQRSTVWXYZ0"}

Response body (JSON)

FieldTypeDescription
ok requiredboolean

Responses

StatusBodyMeaning
200JSONDone.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
402application/problem+jsonThe organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so this can't be changed until an owner adds credit.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonThe sender isn't in the domain's DMARC reports of the last 90 days (sender_unknown), or the organization doesn't list the domain (not_found).
409application/problem+jsonThe name is in use in the domain's DNS (mail_from_in_use), or the domain is being removed (domain_removing).
503application/problem+jsonA temporary problem (unavailable); retry.

Undo a sender's confirmation

POST/v1/health/senders/unconfirm

Undoes a confirmation: the sender's mail no longer counts as the organization's own on Health. Nothing to undo is not an error. Needs domains.manage.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).

Request body (JSON)

FieldTypeDescription
domain requiredstring
name requiredstringThe sender as Health names it: a known service (Mailchimp) or a domain (example-hosting.net).
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"domain":"example.com","name":"Mailchimp","orgId":"org_01JABCDEFGHJKMNPQRSTVWXYZ0"}

Response body (JSON)

FieldTypeDescription
ok requiredboolean

Responses

StatusBodyMeaning
200JSONDone.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
402application/problem+jsonThe organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so this can't be changed until an owner adds credit.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
409application/problem+jsonThe name is in use in the domain's DNS (mail_from_in_use), or the domain is being removed (domain_removing).
503application/problem+jsonA temporary problem (unavailable); retry.

Check a domain's health

POST/v1/organizations/{orgId}/domains/{domain}/health-checks

The domain's items for the organization's Health page (design note 0023), for members with domains.manage: whether it's proven and signs its mail, where its mail is delivered (MX), its list of allowed senders (SPF), its reports instruction (DMARC) and whether the reports reach K8 HQ, and an old provider's leftover records. Each item has a status (ok, attention, action, not_yet, cant_check), plain words, and the exact records to add, replace or delete.

Only the organization's own domains are looked up, and of a domain not yet proven only its nameservers. Lookups are DNS only, through K8 HQ's resolver; what they find is reused for 10 minutes (cached), and fresh (Check again) looks again once the last check is a minute old (againAt). Each call is billed to the organization as 8 api.requests.

A check of a domain whose mail goes to another provider, and never came to K8 HQ, starts the moving checklist (/v1/orgs/move).

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).
orgId (path) requiredstringorgId resource identifier.
domain (path) requiredstringdomain resource identifier.

Request body (JSON)

FieldTypeDescription
freshbooleanCheck again: look the domain up again if the last check is over a minute old.
{}

Response body (JSON)

FieldTypeDescription
health requiredDomainHealth

Responses

StatusBodyMeaning
200JSONThe domain's items.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonNot a domain of this organization (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonIt's being removed (domain_removing).
503application/problem+jsonA temporary problem (unavailable); retry.

Dismiss a Needs-attention finding

POST/v1/organizations/{orgId}/health/dismissals

Saves the item key and current fingerprint after re-reading Health with the caller's current permissions. Action-needed and other statuses cannot be dismissed (400). An old fingerprint is refused (409 health_changed); a hidden or unknown monitor item is refused (403). Needs a person's own session, with no recent-passkey requirement. Domain items need domains.manage; each monitor needs the same access as its Health read, including billing.view, owner-only and current inbox-grant checks. Organization findings are dismissed for everyone who can see them. Own app passwords, sign-in and recovery findings remain personal. Each forwarding finding identifies one forward, and its dismissal is shared with everyone who can read that inbox. Owner and sending findings are visible only to organization owners. No access is granted by a dismissal.

Health reads retain the item with dismissed=true so the app can hide it without changing checklist facts. The flag is absent after its fingerprint changes, and always absent for Action-needed items. Fingerprints ignore poll times and history; monitor fingerprints also ignore daily count changes, but include finding reasons, changed entries and unfamiliar senders. Organization and domain replacement invalidate prior fingerprints. The permission-filtered re-read uses the existing Health check charge (8 api.requests for domain checks, 4 for monitors); saving the dismissal has no extra charge.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).
orgId (path) requiredstringThe organization.

Request body (JSON)

FieldTypeDescription
dismissal requiredHealthDismissal
{"dismissal":{"fingerprint":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","key":"dmarc_senders:example.com","source":"monitor"}}

Response body (JSON)

FieldTypeDescription
ok requiredboolean

Responses

StatusBodyMeaning
200JSONDismissed.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
402application/problem+jsonThe organization is read-only; add credit before making changes.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonThe organization does not list this domain.
409application/problem+jsonThe finding changed (health_changed), the domain is being removed, or the organization is closing.
503application/problem+jsonA temporary problem (unavailable); retry.

The Health monitors

GET/v1/organizations/{orgId}/health/monitors

Read retained scheduled DNS drift, incoming-mail, outbound bounces and credit monitor observations, with at most 35 days of counts, statuses and public DNS changes. Domain findings require domains.manage; incoming mail and bounces require org.events.read. This read performs no DNS/provider checks. Missing observations mean not checked yet; failed checks are explicit. Each call counts as 4 api.requests, paid by K8 HQ while the organization is read-only. Bounces retains seven-day delivery-event counts, rates with known denominators, distinct tenant BOUNCE suppression counts and actual warning/pause state. Its daily check retries failures from 11 UTC, and sending incidents or known infrastructure problems hold it. Existing sending notices are its only immediate notices. DNS Health Action-needed notices are sent immediately after confirmation and copied to configured destinations; digest delivery is not available. Credit and its retained 35-day history require billing.view. availableNano and whole forecast days are exact integer strings; absent days mean no defensible forecast. Credit retries unsuccessful daily checks without completing that date, and adds no duplicate billing notice. Own mail-app observations are available to every current member, including ordinary members; owner role never grants another person’s activity. Only current live canonical IMAP/SMTP passwords are eligible. Daily sampled 14-day activity is anchored to last use, with a 24–48 hour grace period, confirmation on successive dates and retirement after 14 quiet days. Failed or incomplete checks remain retryable. App activity never produces organization events, notices or alarms. Spam and refused-mail counts require a current incoming-mail grant on a live organization inbox, including a zero-access inbox; ownership alone is insufficient. Counts distinguish committed inbox deliveries into Spam, spam or malware DATA refusals per organization, and unknown-address recipient attempts. Missing or partial dates never count as zero. The baseline uses at least 14 complete dates within the preceding 28 dates, excluding the judged date. A count must exceed both 20 and three times the exact median on successive complete dates to raise attention. Refused spam or malware is informational; unknown-address findings stay on the Health page. Volume never creates Action-needed notices or immediate alerts. Trends retain the last 35 completed UTC dates.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
orgId (path) requiredstring

Response body (JSON)

FieldTypeDescription
items requiredMonitorItem[]

Responses

StatusBodyMeaning
200JSONThe monitors.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
503application/problem+jsonA temporary problem (unavailable); retry.

The moving checklist

GET/v1/organizations/{orgId}/mail-move

The organization's move to K8 HQ, if one was started (design note 0023 section 3.7), for members with domains.manage: the domain, the old provider, the steps ticked and the old provider's mail delivery records (the way back). Steps K8 HQ can see for itself aren't stored; the app shows them as they are. move is null when no move was started (or one ended over 30 days ago).

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
orgId (path) requiredstringorgId resource identifier.

Response body (JSON)

FieldTypeDescription
move requiredany
version requiredintegerOpaque numeric revision; zero means no stored state. Send the displayed value with each change. A new record gets a fresh JavaScript-safe base after physical expiry.

Responses

StatusBodyMeaning
200MoveInfoThe move.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
503application/problem+jsonA temporary problem (unavailable); retry.

Change the moving checklist

PATCH/v1/organizations/{orgId}/mail-move

Starts a move (start, with the domain and the old provider), changes its provider, ticks or unticks a step the person does themselves (test, copy, ttl, catchup, devices, cancel, finish), answers what else sends mail as the organization (senders, empty for nothing), or finishes or stops it. Each change is an org.settings.changed event (setting move). No passkey is needed: the checklist changes nothing about mail or access. A finished or stopped move is kept 30 days. Supply the displayed version; stale changes return 409 move_changed. Later edits do not extend retained history, and a completed checklist cannot be reopened: start a new checklist.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).
orgId (path) requiredstringorgId resource identifier.

Request body (JSON)

FieldTypeDescription
move requiredMoveChange
{"move":{"action":"tick","step":"copy"}}

Response body (JSON)

FieldTypeDescription
move requiredany
version requiredintegerOpaque numeric revision; zero means no stored state. Send the displayed value with each change. A new record gets a fresh JavaScript-safe base after physical expiry.

Responses

StatusBodyMeaning
200MoveInfoThe move now.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonNot a domain of this organization (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonSomeone else changed it meanwhile (move_changed): read it again.
503application/problem+jsonA temporary problem (unavailable); retry.