curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/custom-email-domains \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"domain": "example.com",
"sender_name": "Nordwind Furniture",
"from_email": "no-reply@example.com"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/custom-email-domains"
payload = {
"domain": "example.com",
"sender_name": "Nordwind Furniture",
"from_email": "no-reply@example.com"
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain: 'example.com',
sender_name: 'Nordwind Furniture',
from_email: 'no-reply@example.com'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/custom-email-domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/custom-email-domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'example.com',
'sender_name' => 'Nordwind Furniture',
'from_email' => 'no-reply@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/custom-email-domains"
payload := strings.NewReader("{\n \"domain\": \"example.com\",\n \"sender_name\": \"Nordwind Furniture\",\n \"from_email\": \"no-reply@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/custom-email-domains")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"example.com\",\n \"sender_name\": \"Nordwind Furniture\",\n \"from_email\": \"no-reply@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/custom-email-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"example.com\",\n \"sender_name\": \"Nordwind Furniture\",\n \"from_email\": \"no-reply@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}Enable email sending for a domain
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_configurationuntil 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.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/custom-email-domains \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"domain": "example.com",
"sender_name": "Nordwind Furniture",
"from_email": "no-reply@example.com"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/custom-email-domains"
payload = {
"domain": "example.com",
"sender_name": "Nordwind Furniture",
"from_email": "no-reply@example.com"
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain: 'example.com',
sender_name: 'Nordwind Furniture',
from_email: 'no-reply@example.com'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/custom-email-domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/custom-email-domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'example.com',
'sender_name' => 'Nordwind Furniture',
'from_email' => 'no-reply@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/custom-email-domains"
payload := strings.NewReader("{\n \"domain\": \"example.com\",\n \"sender_name\": \"Nordwind Furniture\",\n \"from_email\": \"no-reply@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/custom-email-domains")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"example.com\",\n \"sender_name\": \"Nordwind Furniture\",\n \"from_email\": \"no-reply@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/custom-email-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"example.com\",\n \"sender_name\": \"Nordwind Furniture\",\n \"from_email\": \"no-reply@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}Authorizations
Personal API key.
Path Parameters
ID of the app whose email domains you want to work with.
Body
Request to create email domain configuration.
Domain to send mail from. It has to already be connected to this app.
"example.com"
Name recipients see in the From line.
"Nordwind Furniture"
Address mail is sent from. Its domain has to be the domain you're enabling.
"no-reply@example.com"
Response
Setup started. Read status and dns_records.
Response for creating email domain configuration.
The domain that was enabled.
"example.com"
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.
"pending_user_dns_configuration"
ID of this app's email configuration. It identifies the configuration, not the individual domain.
"68b1c0d4e7b91d003c45a1f2"
Whether you brought the domain yourself (true) or bought it through Base44 (false).
true
Records to publish for this domain. They come back even when Base44 publishes them for you, so you can pass them to whoever manages the domain's DNS.
Show child attributes
Show child attributes
[ { "name": "em1234.example.com", "status": "pending", "ttl": 300, "type": "CNAME", "value": "u1234567.wl123.sendgrid.net" } ]
Identifier for the registrar the domain sits with, when Base44 knows it.
"godaddy"
Was this page helpful?