---
title: "Check the mail of the domains a cutover connects: what it runs on (MX, SPF, DKIM, DMARC, mail app hosts), whether the switch would break it (an MX or mail host that is the website's address, SPF \"a\", mail on the old server) with the exact records to keep and the fixes, and the old zone kept since the analysis. Read-only, at most every 10 s. A cutover of a domain whose mail is at risk needs confirmMail"
method: POST
path: "/migrations/{migrationId}/mail-check"
tags: ["Migrations"]
---

# Check the mail of the domains a cutover connects: what it runs on (MX, SPF, DKIM, DMARC, mail app hosts), whether the switch would break it (an MX or mail host that is the website's address, SPF "a", mail on the old server) with the exact records to keep and the fixes, and the old zone kept since the analysis. Read-only, at most every 10 s. A cutover of a domain whose mail is at risk needs confirmMail

`POST /migrations/{migrationId}/mail-check`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/migrations/{migrationId}/mail-check`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `migrationId` string, uuid, required

## Request body

- object
  - `hostnames` string[]: The domains to check (default: the import's domains, or the one connected)

## Response `200`

The mail check

- object
  - `checkedAt` string, required: ISO-8601 timestamp
  - `blocking` boolean, required: a risk needs the customer's confirmation before the switch (CutoverMigrationInput.confirmMail)
  - `confirmed` boolean: the customer confirmed the risks when the domains were connected
  - `domains` object[], required
    - `domain` string, required
    - `status` 'ok' | 'at_risk' | 'old_host' | 'no_mail' | 'unknown', required: ok: mail runs elsewhere and is not touched · at_risk: the switch would break it unless the fixes are made · old_host: it keeps working, but runs on the old server and stops when the old hosting is cancelled · no_mail: no MX record and no SPF · unknown: the lookups failed
    - `provider` string, nullable, required: a known mail provider by its MX hosts (Google Workspace, Microsoft 365, Hostingsurge …)
    - `mx` object[], required
      - `priority` integer, required
      - `exchange` string, required
      - `addresses` string[], required
      - `via` string[], required
      - `moves` boolean, required
      - `oldServer` boolean, required
    - `spf` string, nullable, required
    - `dmarc` string, nullable, required
    - `dkim` object[], required
      - `selector` string, required
      - `source` 'zone' | 'public' | 'old_zone', required: zone: the old host's zone (served by public DNS) · public: public DNS · old_zone: only in the old host's zone, which public DNS no longer serves (for information: not in use now)
    - `hosts` object[], required: mail app hosts and SRV records (mail, webmail, autodiscover, autoconfig, _imaps._tcp …)
      - `name` string, required
      - `type` string, required
      - `value` string, required
      - `moves` boolean, required
    - `nameservers` string[], required
    - `nameserversAtOldHost` boolean, required
    - `risks` object[], required
      - `code` 'mx_moves' | 'spf_follows_web' | 'mail_host_moves' | 'mail_on_old_host' | 'no_mx' | 'dns_at_old_host' | 'lookup_failed', required
      - `blocking` boolean, required: the switch waits for the customer's confirmation (CutoverMigrationInput.confirmMail)
      - `message` string, required: English
      - `names` string[], required: the record names concerned, relative to the domain
      - `addresses` string[], required: the old mail server's addresses, where the fix needs them
    - `records` object[], required: exactly what to keep, and the fixes to make before the switch (add/change)
      - `type` 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'MX' | 'CAA' | 'NS' | 'SRV', required
      - `name` string, required
      - `value` string, required
      - `action` 'add' | 'change' | 'remove' | 'keep', required
      - `current` string, nullable, required: value observed in public DNS now
      - `reason` string, required
  - `oldDns` object, nullable: the old zone as taken before the switch, with what public DNS answers now
    - `takenAt` string, required: ISO-8601 timestamp
    - `source` 'backup' | 'cpanel' | 'public', required: backup/cpanel: the old host's own zone was read (merged with public DNS); public: public DNS only
    - `serverAddresses` string[]: the old server's addresses, as the old host gave them (mail on them is "on the old server")
    - `domains` object[], required
      - `domain` string, required
      - `records` object[], required
        - `name` string, required
        - `type` string, required
        - `ttl` integer, required
        - `value` string, required
        - `priority` integer, nullable, required: MX preference or SRV priority
        - `source` 'zone' | 'public', required: zone: the old host's own zone (backup or its API); public: what public DNS answered
      - `truncated` boolean, required: more records than kept here (the full zone is in the backup or at the old host)
      - `partial` boolean, required: some lookups failed
      - `zoneServed` boolean, nullable: whether public DNS serves the old host's zone: false when the domain's name servers are elsewhere (its zone-only records are kept here to restore or recreate, but the mail check judges what public DNS answers); null: unknown

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Not available on this server (code not_configured)
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
