---
title: "Who takes a domain’s mail"
method: GET
path: "/api/v1/mail/provider"
tags: ["Desk"]
---

# Who takes a domain’s mail

`GET /api/v1/mail/provider`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/mail/provider`
- Auth: API key in cookie `better-auth.session_token`

Reads the MX records a domain publishes and says which mail provider they name, so an owner connecting a company mailbox is not asked for server details their own DNS already answers.

Only records that name a provider settle anything. A domain whose mail goes to a filter first is reported as filtered with no provider, because the filter says who scans the mail and not who holds it, and offering the wrong provider hands somebody a sign-in screen for a service they do not use. A domain that publishes no MX records at all comes back with an empty list, which is an answer; a lookup no resolver would answer comes back `unreachable`, which is not.

The lookup is DNS, so the answer is public information about the domain and carries nothing about the account asking.

## Query parameters

- `domain` string, required

## Response `200`

What the domain publishes, and who it names.

- object
  - `ok` unknown, required
  - `data` object, required
    - `domain` string, required: The domain that was asked about, lowercased.
    - `mx` string[], required: The mail exchangers the domain publishes, lowest preference first. Empty where it publishes none, which is a real answer about the domain.
    - `providerId` string, nullable, required: The provider those records name (`google`, `microsoft`, `fastmail` and so on), or null where they name one this product holds no settings for.
    - `matched` string, nullable, required: The exchanger the provider was read from.
    - `filter` string, nullable, required: Where the records name a filter such as Mimecast or Proofpoint, its name. A filter scans the mail and does not hold it, so `providerId` stays null.
    - `unreachable` boolean, required: True where no resolver answered. Every other field is then empty because nothing was read, not because nothing is published.
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `400`: `domain` is missing or is not shaped like a domain name.
- `401`: No session. Sign in first.

---

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