Create or update domain redirect
Configure a redirect rule for this domain
Acts as an upsert — if a redirect already exists it is updated; otherwise a new one is created. The domain itself is used as the source (redirect-from) domain.
The domain must be ACTIVE before a redirect can be configured.
Example
import requests
domain_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.post(
f"https://api.coldsend.io/api/public/v1/domains/{domain_id}/redirect",
headers={"X-API-Key": "your-api-key"},
json={
"target_domain": "yourcompany.com",
"status_code": 301,
"preserve_path": True,
"preserve_query_string": True
}
)
print(response.json())
Authorizations
API key with format cs_live_xxx
Path Parameters
Body
Request body for creating or updating a domain redirect.
Domain to redirect to (e.g. 'yourcompany.com')
"yourcompany.com"
HTTP redirect status code (301 permanent, 302 temporary)
301 <= x <= 308Preserve the URL path in the redirect
Preserve query parameters in the redirect
Response
Redirect created or updated successfully
Response for domain redirect operations.
Redirect record ID
Domain being redirected (this domain)
Destination domain
HTTP redirect status code
Path is preserved in redirect
Query string is preserved in redirect
Whether the redirect rule is active
Whether Cloudflare setup completed
Creation timestamp (ISO 8601)

