Skip to content

Reports

Access DMARC aggregate reports and TLS-RPT reports for your domains.

DMARC Reports

List DMARC Reports

GET /api/v1/domains/{id}/reports/dmarc

Returns DMARC aggregate reports for a domain.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max 100)
startDatedatetime-Filter by start date (ISO 8601)
endDatedatetime-Filter by end date (ISO 8601)
includeRecordsbooleanfalseInclude individual report records

Response

json
{
  "data": {
    "reports": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "reportId": "12345678901234567890",
        "orgName": "google.com",
        "email": "noreply-dmarc-support@google.com",
        "dateRangeBegin": "2024-01-14T00:00:00Z",
        "dateRangeEnd": "2024-01-15T00:00:00Z",
        "policyDomain": "example.com",
        "policyP": "reject",
        "policySp": null,
        "policyAdkim": "r",
        "policyAspf": "r",
        "policyPct": 100,
        "totalCount": 1250,
        "passCount": 1240,
        "failCount": 10,
        "receivedAt": "2024-01-15T06:30:00Z"
      }
    ],
    "summary": {
      "totalReports": 15,
      "totalMessages": 25000,
      "passedMessages": 24850,
      "failedMessages": 150,
      "passRate": 99
    }
  },
  "meta": {
    "pagination": {
      "page": 1,
      "limit": 20,
      "hasMore": false
    }
  }
}

Example

bash
# Get last 7 days of DMARC reports
curl -H "Authorization: Bearer ms_your_token" \
  "https://app.mailshield.app/api/v1/domains/550e8400.../reports/dmarc?startDate=2024-01-08T00:00:00Z"

With Individual Records

When includeRecords=true, each report includes detailed records:

json
{
  "reports": [
    {
      "id": "...",
      "orgName": "google.com",
      "totalCount": 1250,
      "records": [
        {
          "id": "...",
          "sourceIp": "203.0.113.1",
          "count": 500,
          "disposition": "none",
          "dkim": "pass",
          "spf": "pass",
          "headerFrom": "example.com",
          "dkimResults": [
            {"domain": "example.com", "result": "pass", "selector": "google"}
          ],
          "spfResults": [
            {"domain": "example.com", "result": "pass"}
          ]
        }
      ]
    }
  ]
}

TLS Reports

List TLS-RPT Reports

GET /api/v1/domains/{id}/reports/tls

Returns TLS-RPT reports for a domain.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max 100)
startDatedatetime-Filter by start date (ISO 8601)
endDatedatetime-Filter by end date (ISO 8601)
includePoliciesbooleanfalseInclude policy details

Response

json
{
  "data": {
    "reports": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "reportId": "smtp-tls-report-12345",
        "organizationName": "Google Inc.",
        "contactInfo": "smtp-tls-reporting@google.com",
        "dateRangeBegin": "2024-01-14T00:00:00Z",
        "dateRangeEnd": "2024-01-15T00:00:00Z",
        "totalSuccessCount": 5000,
        "totalFailureCount": 5,
        "receivedAt": "2024-01-15T08:00:00Z"
      }
    ],
    "summary": {
      "totalReports": 10,
      "totalConnections": 50050,
      "successfulConnections": 50000,
      "failedConnections": 50,
      "successRate": 99
    }
  },
  "meta": {
    "pagination": {
      "page": 1,
      "limit": 20,
      "hasMore": false
    }
  }
}

Example

bash
curl -H "Authorization: Bearer ms_your_token" \
  "https://app.mailshield.app/api/v1/domains/550e8400.../reports/tls?includePolicies=true"

With Policy Details

When includePolicies=true, each report includes policy information:

json
{
  "reports": [
    {
      "id": "...",
      "organizationName": "Google Inc.",
      "totalSuccessCount": 5000,
      "totalFailureCount": 5,
      "policies": [
        {
          "id": "...",
          "policyType": "sts",
          "policyDomain": "example.com",
          "policyString": ["version: STSv1", "mode: enforce"],
          "mxHost": "mail.example.com",
          "successCount": 4995,
          "failureCount": 5,
          "failureDetails": [
            {
              "resultType": "certificate-expired",
              "sendingMtaIp": "172.217.0.1",
              "receivingMxHostname": "mail.example.com",
              "failedSessionCount": 5
            }
          ]
        }
      ]
    }
  ]
}

Report Summary Statistics

Both report types include summary statistics in the response:

DMARC Summary

FieldDescription
totalReportsNumber of reports in response
totalMessagesTotal messages across all reports
passedMessagesMessages that passed DMARC
failedMessagesMessages that failed DMARC
passRatePercentage of passed messages

TLS Summary

FieldDescription
totalReportsNumber of reports in response
totalConnectionsTotal connection attempts
successfulConnectionsSuccessful TLS connections
failedConnectionsFailed TLS connections
successRatePercentage of successful connections

Monitor and secure your email domains.