# get_domain_status

Source: https://modulify.ai/docs/api/domains/get-domain-status

Reads the custom domains of a site, with whether each one is connected and the exact DNS records each hostname needs.

- Title: Check custom domains
- Scope: `config:read`
- Access: Read only
- Endpoint: `POST /v1/get_domain_status`

A site can have up to 10 custom domains, and every connected one serves the same site. Each entry in `domains` carries its `_id`, which is the `domainId` the other domain tools take, the hostname in `Domain` and its www companion in `WwwDomain` if it has one, whether each is connected in `IsConnected` and `WwwIsConnected`, whether the domain is proved to be yours in `Verified`, and `OwnedDomain`.

Every DNS record listed for a hostname, in `RequiredDnsRecords` and `WwwRequiredDnsRecords`, has a `valid` flag saying whether it is already in place and a `checked` flag saying whether the lookup could be completed. `IsCloudflare` says whether the domain's DNS is on Cloudflare. While one of its hostnames is not connected, `DomainConnect` says whether its DNS provider supports one-click setup, and it is `null` once every hostname of that domain is connected or when no supported provider is found.

`OwnedDomain` is null unless the workspace bought the domain, or the domain it is a subdomain of, on its **Domains** page or with `buy_domain`, and that bought domain is active or expiring soon. It then carries that domain's `Id`, `Name`, `ManagedDns`, `Ready` and `Error`, and it is null while the custom domains are paused.

- `ManagedDns` true means the bought domain uses Modulify's nameservers, so Modulify adds the records the site needs to it by itself, keeps them locked in `list_dns_records`, and removes them when the hostname leaves the site. One-click setup is not offered, `DomainConnect` is null, and you add nothing.
- `Ready` true means every record is in place, so the domain connects once DNS servers pick them up.
- `Error` says what keeps Modulify from adding them, usually a record of your own at that name, which you delete with `delete_dns_record` or on the domain's **DNS records** tab. Modulify adds the records within a minute of that.
- `ManagedDns` false means the bought domain uses other nameservers, so you add the records where its DNS is hosted, like any other domain.

See [Records Modulify manages](https://modulify.ai/docs/publish/manage-dns#records-modulify-manages).

While `Verified` is false, the domain still needs its ownership record: `RequiredDnsRecords` includes a TXT record at `_modulify-verification.<domain>`, which for a www hostname sits on its root domain instead, and neither the domain nor its www companion serves the site or counts as connected until that record is found, even when the other records are in place. It only counts as a TXT record at exactly that name, never through a CNAME, and one-click setup never adds it, so you always add it by hand. Every record name in the answer is the full DNS name, such as `_modulify-verification.example.com`, while many DNS hosts expect only the part in front of the zone, such as `_modulify-verification`, or `_modulify-verification.blog` for `blog.example.com`. The tool tells the client to say which form your host wants and never to let the zone appear twice. This call looks for it, and Modulify does too every 10 minutes on its own. Once it is found, `Verified` turns true, the TXT record leaves the list and can be deleted at the DNS host. Buying the domain on the workspace's **Domains** page counts as proof too, so a bought domain turns verified on the next check. A domain still unverified 14 days after it was added, or after it was last checked by this call, the **Domain** panel or chat, is removed from the site, and that count starts over when paused custom domains resume. Connected domains are checked again once a day, and one whose records no longer point at Modulify turns `IsConnected` false until they do again. See [The ownership record](https://modulify.ai/docs/publish/custom-domains#the-ownership-record).

Pass `domainId` to check one domain, or leave it out to check them all. A site with no custom domains answers with an empty list, and the site's pending verification, started by `start_domain_verification` or by `add_custom_domain`, is not listed until `verify_domain` adds it. The primary domain, the one links to the live site use, is the connected entry chosen with `set_primary_domain`, which carries `IsPrimary` true, else the first entry whose domain is connected, or failing that the first connected www companion, and a domain whose root was removed counts with its www hostname in the root's place.

It runs live DNS lookups against public resolvers, so it is slow and its answer lags a change just made at a registrar. It is also the call that re-checks DNS and marks a domain connected once its records are in place, so call it once after a change rather than polling it.

When the workspace has no paid plan any more, the custom domains are [paused](https://modulify.ai/docs/publish/custom-domains#when-your-plan-ends). The answer then carries `paused` true and lists the domains as they are, without any DNS lookup, and none of them serves the site until the workspace is on a paid plan again, when they come back on their own. See [Connect a custom domain](https://modulify.ai/docs/publish/custom-domains).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/get_domain_status`, sending the inputs below as a JSON object. The token needs the `config:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/get_domain_status \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","workspaceId":"WORKSPACE_ID"}'
```

Over MCP, the same method is the [get_domain_status tool](https://modulify.ai/docs/mcp/domains/get-domain-status).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `workspaceId` | string | Yes | The workspace the site belongs to. |
| `domainId` | string | No | The `_id` of one custom domain to check, as `get_domain_status` or `add_custom_domain` returned it. Leave it out to check every domain of the site. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.