Enable email sending for a domain

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Turns on email sending from a domain the app already owns, so your app's email comes from your own address instead of Base44's.

The domain has to be connected to the app first, and ready. A domain you brought yourself must be verified, and one bought through Base44 must have finished propagating. Until then the call fails, and the message says which requirement is missing.

An app sends emails from one domain at a time. If one is already set up, this call is rejected whatever state that domain is in. Disable it first, or use Replace the email domain, which keeps the current domain sending while the new one verifies.

Email isn't live when this returns. The domain still needs DNS records in place, and who publishes them depends on who runs its DNS:

  • When Base44 runs the DNS, it writes the records itself and the domain moves toward verification on its own.
  • When you run the DNS, publish the records yourself. The domain waits at pending_user_dns_configuration until they resolve.

Either way the records come back in dns_records, so you can pass them to whoever manages the domain's DNS.

Poll List email domains until configuration_status reads active, which is when mail starts sending.

Turning a domain back on after you disabled it skips the DNS and verification steps. It returns to the state it was in, so a domain that was already sending resumes at once.

post/api/apps/{app_id}/custom-email-domains

Path parameters

app_idstring required

ID of the app whose email domains you want to work with.

ID of the app whose email domains you want to work with.

Request body

domainstring required

Domain to send mail from. It has to already be connected to this app.

sender_namestring required

Name recipients see in the From line.

from_emailstring email required

Address mail is sent from. Its domain has to be the domain you're enabling.

Example request

{
  "domain": "example.com",
  "sender_name": "Nordwind Furniture",
  "from_email": "no-reply@example.com"
}

Response

Setup started. Read status and dns_records.

domainstring required

The domain that was enabled.

statusstring required

Where setup got to. Only active sends mail. The pending_ values mean setup is still in progress, and the failed_ values mean it stopped and you can start it again with Retry email domain setup.

email_domain_idstring required

ID of this app's email configuration. It identifies the configuration, not the individual domain.

externalboolean

Whether you brought the domain yourself (true) or bought it through Base44 (false).

provider_idstring nullable

Identifier for the registrar the domain sits with, when Base44 knows it.

Example response

{
  "domain": "example.com",
  "status": "pending_user_dns_configuration",
  "email_domain_id": "68b1c0d4e7b91d003c45a1f2",
  "external": true,
  "dns_records": [
    {
      "name": "em1234.example.com",
      "status": "pending",
      "ttl": 300,
      "type": "CNAME",
      "value": "u1234567.wl123.sendgrid.net"
    }
  ],
  "provider_id": "godaddy"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.