Update a domain
/api/v1/domains/{domain}Parameters
| Name | In | Type | Description |
|---|---|---|---|
domainrequired | path | string | The domain id, or the domain name itself. |
Request body
domainstringRename the domain, like
yourdomain.com.descriptionstringOptional. A note for your team, shown in the dashboard.
statusstringActive | InactiveTurn the domain off (
Inactive) or back on (Active).storage_quotaintegerOptional. Total storage for all mailboxes on this domain, in megabytes.
max_email_accountsintegerOptional. The most mailboxes this domain may have.
default_email_account_storage_quotaintegerOptional. Storage a new mailbox on this domain gets, in megabytes, unless you give it its own.
is_activebooleanWhether it is switched on. Defaults to true.
settingsobjectOptional. DNS preferences saved with the domain.
dmarc_policystringnone | quarantine | rejectWhat receiving servers should do with mail that fails DMARC:
none,quarantineorreject.spf_recordstringThe SPF record you use for this domain.
dkim_enabledbooleanSign this domain's mail with DKIM.
mx_priorityintegerThe MX record's priority, lowest first.
Request
/api/v1/domains/{domain}curl -X PATCH 'https://app.mailyte.com/api/v1/domains/yourdomain.com' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"domain": "yourdomain.com",
"description": "Everyone who signed up at GITEX"
}'const response = await fetch('https://app.mailyte.com/api/v1/domains/yourdomain.com', {
method: 'PATCH',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"domain": "yourdomain.com",
"description": "Everyone who signed up at GITEX"
}),
});
const { data } = await response.json();import requests
response = requests.patch(
"https://app.mailyte.com/api/v1/domains/yourdomain.com",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
json={
"domain": "yourdomain.com",
"description": "Everyone who signed up at GITEX"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->patch('https://app.mailyte.com/api/v1/domains/yourdomain.com', [
'domain' => 'yourdomain.com',
'description' => 'Everyone who signed up at GITEX',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/domains/yourdomain.com")
request = Net::HTTP::Patch.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
request["Content-Type"] = "application/json"
request.body = {
"domain": "yourdomain.com",
"description": "Everyone who signed up at GITEX"
}.to_json
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.descriptionstringYour own note on the domain. Null when none was set.
statestringactive | provisioning | failed | disabledThe one lifecycle answer.
disabledwins 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: readstateto decide what a domain can do, and this to explain why.statestringpending | provisioning | active | failed | suspended | deleting | deletedWhere the domain is in setup on the mail server:
pending,provisioning,active,failed,suspended,deletingordeleted. For what the domain can do, readstate.errorstringThe last setup or DNS error recorded. Null when there is none. It can be set even on an active domain, so check
stateorGET /domains/{domain}/verification-statusbefore showing it.retryablebooleanWhether
POST /domains/{domain}/retry-provisioningwould do anything. True exactly whenstateisfailed.
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. Every field is always a number. For what the mail server is enforcing right now, use
GET /domains/{domain}/limits.storage_bytesintegerHow many bytes of mail this domain may store in total. The default is 10 GB.
max_mailboxesintegerHow many mailboxes this domain may have. The default is 50.
mailboxes_usedintegerHow many mailboxes the domain has now.
defaultsobjectWhat a NEW mailbox on this domain inherits. Nothing here describes an existing mailbox.
mailbox_storage_bytesintegerHow many bytes of storage each new mailbox gets. The default is 3 GB.
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.