Mail API reference

Mail API · Domains

get/v1/workspaces/{workspace_id}/domains/lookupAuth

Look up a domain before adding it: zone, DNS provider, Domain Connect support, a better subdomain, existing records.

Creates nothing. Resolves only names at or under `fqdn` and its zone apex, plus the Domain Connect endpoints the zone advertises (fetched through the SSRF guard; cached per zone for an hour). Limited to 30 lookups per workspace per minute.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Query parameters

fqdn*string · hostname

Domain to look up (not created).

Response · 200

fqdn*string

The domain that was looked up.

Example: "acme.com"

zone*string

Zone apex found by walking SOA records; null when the domain does not resolve.

Example: "acme.com"

provider*object
id*object

Provider id, matching the console's provider guides.

name*string

Display name of the DNS provider.

Example: "Cloudflare"

source*object

How it was identified: NS host names, or the Domain Connect settings the zone advertises.

nameservers*array

The zone's nameservers that identified the provider.

Example: ["ns1.digitalocean.com","ns2.digitalocean.com"]

domain_connect*object
available*boolean

Our Domain Connect template is onboarded at this provider: one-click setup is possible.

supported*boolean

The zone's DNS provider runs Domain Connect at all.

provider_id*string

Domain Connect provider id; null when the zone does not advertise one.

Example: "cloudflare.com"

provider_name*string

Domain Connect provider name; null when unknown.

Example: "Cloudflare"

reason*object

Why `available` is false: the zone advertises no Domain Connect (`no_record`), its settings could not be read (`settings_unreachable`), the provider has not onboarded our template (`template_not_onboarded`), DNS did not answer (`lookup_failed`), or the provider is ready but ProductCraft has not switched Domain Connect on yet (`disabled`).

suggestion*object

A better name to send from when an apex was typed: `mail.<apex>`, or `send.<apex>` when `mail.` already has other records.

existing*object

Records already there that will matter.

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/domains/lookup
Authorization: Bearer YOUR_TOKEN

Response

{
  "fqdn": "acme.com",
  "zone": "acme.com",
  "provider": {
    "id": {},
    "name": "Cloudflare",
    "source": {},
    "nameservers": [
      "ns1.digitalocean.com",
      "ns2.digitalocean.com"
    ]
  },
  "domain_connect": {
    "available": false,
    "supported": false,
    "provider_id": "cloudflare.com",
    "provider_name": "Cloudflare",
    "reason": {}
  },
  "suggestion": {},
  "existing": {}
}