Skip to main content

Set domain redirect URL

Set the redirect URL for an existing domain where visitors will be redirected when they open your domain. You can set it only after the domain is ready to use, meaning that get domain endpoint returns is_ready as true.

Request

Endpoint

PATCH https://api.woodpecker.co/rest/v2/domains/{domain_name}/set_redirect_url

Headers

x-api-key: {YOUR_API_KEY}
Content-Type: application/json

For details on how to authenticate your requests, please see the authentication guide.

Parameters

ParameterRequiredTypeDescription
domain_nameYesstringDomain name

Body

{
"domain_redirect_url": "https://example.com"
}

Body schema

FieldTypeRequiredDescription
domain_redirect_urlstringYesRedirect URL. Use an empty string to remove an existing redirect. A non-empty value must start with http:// or https://

Request samples

Set redirect URL

curl --request PATCH \
--url "https://api.woodpecker.co/rest/v2/domains/example.com/set_redirect_url" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"domain_redirect_url": "https://example.com"
}'

Response

Response examples

The redirect URL update has been accepted