curl --request PUT \
--url https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_domain": "www.example.com"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect"
payload = { "target_domain": "www.example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_domain: 'www.example.com'})
};
fetch('https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect', 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-domains/{domain_id}/redirect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'target_domain' => 'www.example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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-domains/{domain_id}/redirect"
payload := strings.NewReader("{\n \"target_domain\": \"www.example.com\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_domain\": \"www.example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_domain\": \"www.example.com\"\n}"
response = http.request(request)
puts response.read_body{
"app_id": "6820f3a4e7b91d003c45a1f2",
"disabled": false,
"domain": "example.com",
"id": "68b1c0d4e7b91d003c45a1f7",
"last_status_check": "2026-08-15T09:10:00",
"last_status_payload": {
"verificationStatus": "verified"
},
"provider_id": "wix",
"redirect_target_domain": "www.example.com"
}Set custom domain redirect
Sends every visitor of this domain to another of the app’s domains with a 301 redirect, or stops redirecting when target_domain is null.
The target has to be another verified custom domain on the same app, and every redirect resolves in one hop. So the target can’t already redirect somewhere else, this domain can’t already be another domain’s target, and two domains can’t redirect to each other.
Setting a redirect is limited to 30 requests an hour per caller. Some workspaces have a different limit.
curl --request PUT \
--url https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_domain": "www.example.com"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect"
payload = { "target_domain": "www.example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_domain: 'www.example.com'})
};
fetch('https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect', 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-domains/{domain_id}/redirect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'target_domain' => 'www.example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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-domains/{domain_id}/redirect"
payload := strings.NewReader("{\n \"target_domain\": \"www.example.com\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_domain\": \"www.example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/custom-domains/{domain_id}/redirect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_domain\": \"www.example.com\"\n}"
response = http.request(request)
puts response.read_body{
"app_id": "6820f3a4e7b91d003c45a1f2",
"disabled": false,
"domain": "example.com",
"id": "68b1c0d4e7b91d003c45a1f7",
"last_status_check": "2026-08-15T09:10:00",
"last_status_payload": {
"verificationStatus": "verified"
},
"provider_id": "wix",
"redirect_target_domain": "www.example.com"
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app the domain belongs to.
ID of the custom domain. Get this from List custom domains.
Body
Domain to send this domain's visitors to, or null to stop redirecting. It has to be another verified custom domain on the same app.
"www.example.com"
Response
The domain, with its new redirect.
A custom domain attached to an app.
ID of the app the domain serves.
"6820f3a4e7b91d003c45a1f2"
Whether Base44 has stopped serving the domain. A disabled domain stays attached to the app and keeps its DNS, and serves a placeholder page instead of the app.
false
The domain name, normalized to lower case with any scheme, trailing slash and leading www. removed.
"example.com"
ID of the domain. Pass it as domain_id to the other domain endpoints.
"68b1c0d4e7b91d003c45a1f7"
When Get custom domain status last ran for this domain, as a UTC timestamp in ISO 8601 format, or null if it never has.
"2026-08-15T09:10:00"
The provider's last report on the domain, or null until a status check has run.
Show child attributes
Show child attributes
Names the registrar when the domain was bought through Base44's Wix flow. The value is null otherwise, which covers both a domain you own elsewhere and one bought through the Entri flow, so this isn't a purchased-versus-external signal.
"wix"
The domain that visitors to this one are sent to with a 301 redirect. The value is null when this domain serves the app itself.
"www.example.com"
Was this page helpful?