# Get Sender Domain DNS Setup

Reads expected sender-domain DNS records and their last stored actual state; no live lookup. Expected type/value pairs are alternatives: publish exactly one per record, normally the first. A check result is fresh only when every checkedAt is at least lastDnsCheckRequestedAt; null means no result yet.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "domainId": {
      "type": "integer",
      "description": "ID of the sender domain whose required DNS records to read",
      "minimum": 1
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account that owns the domain; omit for the account the access token belongs to, or pass a subaccount the token owner may configure",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "domainId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "domain",
    "status",
    "records"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "domain": {
      "type": "object",
      "required": [
        "id",
        "domain",
        "status",
        "statusExplanation",
        "isUsableForSending",
        "usableFrom",
        "isDefault",
        "dkimOnly",
        "settingsUrl"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "domain": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "new",
            "active",
            "verified"
          ]
        },
        "statusExplanation": {
          "type": "string"
        },
        "isUsableForSending": {
          "type": "boolean"
        },
        "usableFrom": {
          "type": [
            "string",
            "null"
          ]
        },
        "isDefault": {
          "type": "boolean"
        },
        "dkimOnly": {
          "type": "boolean"
        },
        "settingsUrl": {
          "type": "string"
        }
      }
    },
    "status": {
      "type": "string"
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "host",
          "expectedTypes",
          "expectedValues",
          "expectedTtl",
          "expectedPriority",
          "optional",
          "informational",
          "status",
          "statusExplanation",
          "checkedAt",
          "actualType",
          "actualHost",
          "actualValue",
          "actualTtl",
          "actualPriority",
          "message"
        ],
        "properties": {
          "host": {
            "type": "string"
          },
          "expectedTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expectedValues": {
            "type": [
              "object",
              "array"
            ],
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "expectedTtl": {
            "type": "integer"
          },
          "expectedPriority": {
            "type": [
              "integer",
              "null"
            ]
          },
          "optional": {
            "type": "boolean"
          },
          "informational": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "statusExplanation": {
            "type": "string"
          },
          "checkedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "actualType": {
            "type": [
              "string",
              "null"
            ]
          },
          "actualHost": {
            "type": [
              "string",
              "null"
            ]
          },
          "actualValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "actualTtl": {
            "type": [
              "integer",
              "null"
            ]
          },
          "actualPriority": {
            "type": [
              "integer",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}
```

