DMARC — K8 HQ Content API
DMARC operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Who sends mail as your domains and whether it passes, from DMARC reports, with K8's summaries.
What the DMARC aggregate reports about the organization's domains say (who sends as them, what passes and fails and why), the reports themselves, and K8's summaries of them.
Base URL
| Base URL | For |
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
DMARC
DMARC reports: domains and settings
GET/dmarc
What the DMARC reports page needs (design note 0016): the organization's verified domains, whether its reports inbox exists yet (receiving), whether alerts get K8's one-line summary (aiSummaries), whether the caller may change that (mayChange, org.settings.change) and whether the caller may ask K8 for summaries (k8). People signed in to the web app with domains.manage (owners and admins by default, ?org=); not for access tokens or K8's delegated tokens: reports map the organization's sending services, and K8 never reads them.
For 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 |
aiSummaries required | boolean | Whether DMARC alerts include K8's one-line summary. |
domains required | string[] | The organization's verified domains. |
k8 required | boolean | Whether the caller may ask K8 to summarize reports. |
mayChange required | boolean | Whether the caller may change aiSummaries (org.settings.change). |
receiving required | boolean | Whether the organization has its DMARC reports inbox (set up with the domain). |
Responses
| Status | Body | Meaning |
| 200 | DmarcOverview | The domains and settings. |
| 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 a domain's DMARC reports
GET/dmarc/domains/{domain}/reports
The aggregate reports received about a domain, newest first: who sent each, the period it covers, the published policy and how many messages passed and failed DMARC. Counts only; GET .../reports/{report} has the sources. People signed in to the web app with domains.manage (owners and admins by default, ?org=); not for access tokens or K8's delegated tokens: reports map the organization's sending services, and K8 never reads them.
For 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. |
domain (path) required | string | One of the organization's verified domains. |
cursor (query) | string | From the previous page's nextCursor. |
limit (query) | integer | Reports per page, 1 to 200 (default 50). |
Response body (JSON)
| Field | Type | Description |
reports required | DmarcReport[] | |
nextCursor | string | Present while there are more. |
Responses
| Status | Body | Meaning |
| 200 | DmarcReports | The reports. |
| 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 a DMARC report's sources
GET/dmarc/domains/{domain}/reports/{report}
One report's sending sources (at most 200, failures first; omitted counts the rest, which the full XML has): address, reverse DNS (looked up when the report arrived; a label, not proof), message count, disposition, the aligned SPF and DKIM results, the raw SPF and DKIM checks and domains, header and envelope From, and the likely cause K8 HQ worked out (cause, in words as likely). summary is K8's summary when one was made. People signed in to the web app with domains.manage (owners and admins by default, ?org=); not for access tokens or K8's delegated tokens: reports map the organization's sending services, and K8 never reads them.
For 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. |
domain (path) required | string | One of the organization's verified domains. |
report (path) required | string | The report's id (its message, msg_). |
Response body (JSON)
| Field | Type | Description |
omitted required | integer | Sources left out (past 200); the full XML has them. |
parsedAt required | string | When K8 HQ read the report. |
report required | DmarcReport | |
sources required | DmarcSource[] | |
summary | string | K8's summary, when one was made (Markdown: paragraphs and lists). |
Responses
| Status | Body | Meaning |
| 200 | DmarcReportDetail | The report. |
| 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). |
Summarize a DMARC report with K8
POST/dmarc/domains/{domain}/reports/{report}/summary
K8's plain-words summary of one report: what's failing, the likely causes and what to do. K8 sees only the report's parsed fields (addresses, names, results, counts), never mail. Billed to the organization as a K8 question (about a cent), within its daily K8 limit; made once and kept, so asking again is free (cached). Needs K8 (k8.use, or members' use of K8 left on) as well as people signed in to the web app with domains.manage (owners and admins by default, ?org=); not for access tokens or K8's delegated tokens: reports map the organization's sending services, and K8 never reads them.
For 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. |
domain (path) required | string | One of the organization's verified domains. |
report (path) required | string | The report's id (its message, msg_). |
Response body (JSON)
| Field | Type | Description |
cached required | boolean | Made earlier and kept (not billed again). |
summary required | string | K8's summary (Markdown: paragraphs and lists; no links). |
Responses
| Status | Body | Meaning |
| 200 | DmarcSummary | K8's summary. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is out of credit (out_of_credit). |
| 403 | application/problem+json | Not allowed (forbidden), or K8 isn't available to the caller in the organization (k8_unavailable): K8 is off for members, or the person is suspended. |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | K8 is already summarizing this report for someone (conflict); retry shortly. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | The organization's or the person's daily K8 limit, or too many questions a minute (rate_limited). |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Download a DMARC report's XML
GET/dmarc/domains/{domain}/reports/{report}/xml
The report as its sender wrote it, decompressed (RFC 7489 appendix C), as an attachment. Recorded in the audit log as a content read (access.content.read, part dmarc-xml) and metered like one. People signed in to the web app with domains.manage (owners and admins by default, ?org=); not for access tokens or K8's delegated tokens: reports map the organization's sending services, and K8 never reads them.
For 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. |
domain (path) required | string | One of the organization's verified domains. |
report (path) required | string | The report's id (its message, msg_). |
Responses
| Status | Body | Meaning |
| 200 | application/xml | The report's XML. |
| 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). |
| 422 | application/problem+json | The report's XML couldn't be read from its message (rejected). |
| 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). |
Summarize a domain's DMARC reports over 7 or 30 days
POST/dmarc/domains/{domain}/summary
K8's summary of every report about the domain received in the last 7 or 30 days (at most 200; reports whose own message failed authentication are left out), with the sources merged across reports. K8 sees only the reports' parsed fields. Billed to the organization as a K8 question (about a cent), within its daily K8 limit; not kept. With no reports in the period, summary is empty and nothing is billed. Needs K8 (k8.use, or members' use of K8 left on) as well as people signed in to the web app with domains.manage (owners and admins by default, ?org=); not for access tokens or K8's delegated tokens: reports map the organization's sending services, and K8 never reads them.
For 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. |
domain (path) required | string | One of the organization's verified domains. |
Request body (JSON)
| Field | Type | Description |
days required | integer | The period in days: 7 or 30. |
Response body (JSON)
| Field | Type | Description |
reports required | integer | Reports it covers. |
summary required | string | K8's summary (Markdown: paragraphs and lists; no links); empty when there were no reports. |
Responses
| Status | Body | Meaning |
| 200 | DmarcPeriodSummary | K8's summary. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is out of credit (out_of_credit). |
| 403 | application/problem+json | Not allowed (forbidden), or K8 isn't available to the caller in the organization (k8_unavailable): K8 is off for members, or the person is suspended. |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | K8 is already summarizing this report for someone (conflict); retry shortly. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | The organization's or the person's daily K8 limit, or too many questions a minute (rate_limited). |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Turn K8's line in DMARC alerts on or off
PATCH/dmarc/settings
Whether DMARC alerts include K8's one-line summary of the report (on unless turned off). Each line is a K8 call billed to the organization (under half a cent), at most one per report and 20 a day. People signed in to the web app with org.settings.change (owners by default), with a passkey used in the last 5 minutes (401 step_up_required otherwise).
For the web app. 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
| 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. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
aiSummaries required | boolean | Whether DMARC alerts include K8's one-line summary. |
Response body (JSON)
| Field | Type | Description |
aiSummaries required | boolean | Whether DMARC alerts include K8's one-line summary. |
Responses
| Status | Body | Meaning |
| 200 | DmarcSettings | Saved. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 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). |