Update a domain

PATCH/api/v1/domains/{domain}
Requires anorganization API keywith the scopedomains:write

Parameters

NameInTypeDescription
domainrequiredpathstringThe domain id, or the domain name itself.

Request body

  • domainstring

    Rename the domain, like yourdomain.com.

  • descriptionstring

    Optional. A note for your team, shown in the dashboard.

  • statusstringActive | Inactive

    Turn the domain off (Inactive) or back on (Active).

  • storage_quotainteger

    Optional. Total storage for all mailboxes on this domain, in megabytes.

  • max_email_accountsinteger

    Optional. The most mailboxes this domain may have.

  • default_email_account_storage_quotainteger

    Optional. Storage a new mailbox on this domain gets, in megabytes, unless you give it its own.

  • is_activeboolean

    Whether it is switched on. Defaults to true.

  • settingsobject

    Optional. DNS preferences saved with the domain.

    • dmarc_policystringnone | quarantine | reject

      What receiving servers should do with mail that fails DMARC: none, quarantine or reject.

    • spf_recordstring

      The SPF record you use for this domain.

    • dkim_enabledboolean

      Sign this domain's mail with DKIM.

    • mx_priorityinteger

      The MX record's priority, lowest first.

Request

PATCH/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"
  }'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • objectstringdomain
    • idstring

      Unique identifier for the domain.

    • namestring

      The domain itself, e.g. example.com.

    • descriptionstring

      Your own note on the domain. Null when none was set.

    • statestringactive | provisioning | failed | disabled

      The one lifecycle answer. disabled wins over everything: a disabled domain does nothing whatever its provisioning says.

    • provisioningobject

      How 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 | deleted

        Where the domain is in setup on the mail server: pending, provisioning, active, failed, suspended, deleting or deleted. For what the domain can do, read state.

      • errorstring

        The last setup or DNS error recorded. Null when there is none. It can be set even on an active domain, so check state or GET /domains/{domain}/verification-status before showing it.

      • retryableboolean

        Whether POST /domains/{domain}/retry-provisioning would do anything. True exactly when state is failed.

    • sendingobject

      Sending needs SPF and DKIM. Separate from receiving, because a customer who only relays through us must not publish an MX record.

      • enabledboolean
      • requiresarray<string>
    • receivingobject

      Receiving needs MX.

      • enabledboolean
      • requiresarray<string>
    • limitsobject

      What 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_bytesinteger

        How many bytes of mail this domain may store in total. The default is 10 GB.

      • max_mailboxesinteger

        How many mailboxes this domain may have. The default is 50.

      • mailboxes_usedinteger

        How many mailboxes the domain has now.

    • defaultsobject

      What a NEW mailbox on this domain inherits. Nothing here describes an existing mailbox.

      • mailbox_storage_bytesinteger

        How many bytes of storage each new mailbox gets. The default is 3 GB.

    • created_atstring
    • updated_atstring

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The 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.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too 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.