K8 HQ

DMARC — K8 HQ Content API

DMARC 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.

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

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
aiSummaries requiredbooleanWhether DMARC alerts include K8's one-line summary.
domains requiredstring[]The organization's verified domains.
k8 requiredbooleanWhether the caller may ask K8 to summarize reports.
mayChange requiredbooleanWhether the caller may change aiSummaries (org.settings.change).
receiving requiredbooleanWhether the organization has its DMARC reports inbox (set up with the domain).

Responses

StatusBodyMeaning
200DmarcOverviewThe domains and settings.
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 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

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.
domain (path) requiredstringOne of the organization's verified domains.
cursor (query)stringFrom the previous page's nextCursor.
limit (query)integerReports per page, 1 to 200 (default 50).

Response body (JSON)

FieldTypeDescription
reports requiredDmarcReport[]
nextCursorstringPresent while there are more.

Responses

StatusBodyMeaning
200DmarcReportsThe reports.
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 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

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.
domain (path) requiredstringOne of the organization's verified domains.
report (path) requiredstringThe report's id (its message, msg_).

Response body (JSON)

FieldTypeDescription
omitted requiredintegerSources left out (past 200); the full XML has them.
parsedAt requiredstringWhen K8 HQ read the report.
report requiredDmarcReport
sources requiredDmarcSource[]
summarystringK8's summary, when one was made (Markdown: paragraphs and lists).

Responses

StatusBodyMeaning
200DmarcReportDetailThe report.
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).

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

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.
domain (path) requiredstringOne of the organization's verified domains.
report (path) requiredstringThe report's id (its message, msg_).

Response body (JSON)

FieldTypeDescription
cached requiredbooleanMade earlier and kept (not billed again).
summary requiredstringK8's summary (Markdown: paragraphs and lists; no links).

Responses

StatusBodyMeaning
200DmarcSummaryK8's summary.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe organization is out of credit (out_of_credit).
403application/problem+jsonNot 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.
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonK8 is already summarizing this report for someone (conflict); retry shortly.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonThe organization's or the person's daily K8 limit, or too many questions a minute (rate_limited).
503application/problem+jsonTemporary 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

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.
domain (path) requiredstringOne of the organization's verified domains.
report (path) requiredstringThe report's id (its message, msg_).

Responses

StatusBodyMeaning
200application/xmlThe report's XML.
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).
422application/problem+jsonThe report's XML couldn't be read from its message (rejected).
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).

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

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.
domain (path) requiredstringOne of the organization's verified domains.

Request body (JSON)

FieldTypeDescription
days requiredintegerThe period in days: 7 or 30.

Response body (JSON)

FieldTypeDescription
reports requiredintegerReports it covers.
summary requiredstringK8's summary (Markdown: paragraphs and lists; no links); empty when there were no reports.

Responses

StatusBodyMeaning
200DmarcPeriodSummaryK8's summary.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe organization is out of credit (out_of_credit).
403application/problem+jsonNot 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.
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonK8 is already summarizing this report for someone (conflict); retry shortly.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonThe organization's or the person's daily K8 limit, or too many questions a minute (rate_limited).
503application/problem+jsonTemporary 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

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.
Idempotency-Key (header)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
aiSummaries requiredbooleanWhether DMARC alerts include K8's one-line summary.

Response body (JSON)

FieldTypeDescription
aiSummaries requiredbooleanWhether DMARC alerts include K8's one-line summary.

Responses

StatusBodyMeaning
200DmarcSettingsSaved.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe 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.
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).