Skip to main content
POST
Create or update domain redirect

Authorizations

X-API-Key
string
header
required

API key with format cs_live_xxx

Path Parameters

domain_id
string<uuid>
required

Body

application/json

Request body for creating or updating a domain redirect.

target_domain
string
required

Domain to redirect to (e.g. 'yourcompany.com')

Example:

"yourcompany.com"

status_code
integer
default:301

HTTP redirect status code (301 permanent, 302 temporary)

Required range: 301 <= x <= 308
preserve_path
boolean
default:true

Preserve the URL path in the redirect

preserve_query_string
boolean
default:true

Preserve query parameters in the redirect

Response

Redirect created or updated successfully

Response for domain redirect operations.

redirect_id
string
required

Redirect record ID

source_domain
string
required

Domain being redirected (this domain)

target_domain
string
required

Destination domain

status_code
integer
required

HTTP redirect status code

preserve_path
boolean
required

Path is preserved in redirect

preserve_query_string
boolean
required

Query string is preserved in redirect

is_active
boolean
required

Whether the redirect rule is active

setup_completed
boolean
required

Whether Cloudflare setup completed

created_at
string
required

Creation timestamp (ISO 8601)