Skip to main content
POST
/
api
/
public
/
v1
/
domains
/
{domain_id}
/
redirect
Create or update domain redirect
curl --request POST \
  --url https://api.coldsend.pro/api/public/v1/domains/{domain_id}/redirect \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "target_domain": "yourcompany.com",
  "status_code": 301,
  "preserve_path": true,
  "preserve_query_string": true
}
'
{
  "redirect_id": "<string>",
  "source_domain": "<string>",
  "target_domain": "<string>",
  "status_code": 123,
  "preserve_path": true,
  "preserve_query_string": true,
  "is_active": true,
  "setup_completed": true,
  "created_at": "<string>"
}

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)