Retrieve a domain
/api/v1/domains/{domain}Parameters
| Name | In | Type | Description |
|---|---|---|---|
domainrequired | path | string | The domain id, or the domain name itself. |
Request
/api/v1/domains/{domain}curl -X GET 'https://app.mailyte.com/api/v1/domains/yourdomain.com' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY'const response = await fetch('https://app.mailyte.com/api/v1/domains/yourdomain.com', {
method: 'GET',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
},
});
const { data } = await response.json();import requests
response = requests.get(
"https://app.mailyte.com/api/v1/domains/yourdomain.com",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->get('https://app.mailyte.com/api/v1/domains/yourdomain.com');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/domains/yourdomain.com")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectobjectstringdomainidstringUnique identifier for the domain.
namestringThe domain itself, e.g. `example.com`.
descriptionstringA free-text note the customer set on the domain. Null means NONE was ever given -- the column is nullable and nothing defaults it. It is not withheld and it is not unknown.
statestringactive | provisioning | failed | disabledThe one lifecycle answer. `disabled` wins over everything: a disabled domain does nothing whatever its provisioning says.
provisioningobjectHow far this domain has got on the mail server. This is the detail behind `state`, not a second answer to it: read `state` to decide what a domain can do, and this to explain why.
statestringpending | provisioning | active | failed | suspended | deleting | deletedThe mail-server provisioning lifecycle, a closed set: `pending` -> `provisioning` -> `active` or `failed`; `active` -> `suspended`; any live state -> `deleting` -> `deleted`. Never null for a stored domain -- the column is NOT NULL and defaults to `pending`, so every domain has one from the moment it is created. Distinct from the published `state`, which answers what the domain can do rather than where it is on the mail server.
errorstringWhy provisioning last failed. Null means NONE is recorded -- nothing has failed, or the last failure was cleared. **A non-null error does not imply `state` is `failed`.** The two are written by different code paths on different lifecycles: DNS verification writes this column while `state` tracks mail-server provisioning, so a fully active domain can carry a populated DNS error here. Read `state`, or `GET /domains/{domain}/verification-status`, before showing this to anyone.
retryablebooleanWhether `POST /domains/{domain}/retry-provisioning` would do anything. True exactly when `state` is `failed`.
sendingobjectSending needs SPF and DKIM. Separate from receiving, because a customer who only relays through us must not publish an MX record.
enabledbooleanrequiresarray<string>
receivingobjectReceiving needs MX.
enabledbooleanrequiresarray<string>
limitsobjectWhat this domain is allowed, as Mailyte records it. Every field here is always present and always a number -- there is no "unlimited" domain, and null is not how one would be expressed. Contrast `GET /domains/{domain}/limits`, which reports what the MAIL SERVER is enforcing and can genuinely answer "unknown".
storage_bytesintegerBytes of mail this domain may store in total. Never null for a stored domain: the column is NOT NULL and defaults to 10 GB, so a cap always exists. Null is therefore not "no limit" and not "unknown" -- it is a value this endpoint does not produce.
max_mailboxesintegerHow many mailboxes may exist on this domain. Never null for a stored domain -- the column is NOT NULL and defaults to 50. There is no "uncapped" domain to express, so do not read a null as permission to create without limit.
mailboxes_usedintegerHow many exist now. A real count, never null and never omitted: every operation that returns a domain loads it first, precisely so a listed domain and a fetched one carry the same fields. 0 means the domain genuinely has no mailboxes.
defaultsobjectWhat a NEW mailbox on this domain inherits. Nothing here describes an existing mailbox.
mailbox_storage_bytesintegerBytes each new mailbox is given. Never null for a stored domain -- the column is NOT NULL and defaults to 3 GB. Null would not mean "unlimited"; an unlimited mailbox is not something this field can express.
created_atstringupdated_atstring
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist. |
403 | The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys. |
404 | No such resource in this organization. |
422 | The request was understood but the values were not acceptable. |
429 | Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait. |
Every status, with what causes it and what to do, is on the error reference.