Add a domain and its catch-all redirect
const url = 'https://app.routeseam.com/api/v1/domains';const options = { method: 'POST', headers: {'X-Api-Key': '<X-Api-Key>', 'Content-Type': 'application/json'}, body: '{"hostname":"old.com","destination":"https://new.com","status_code":308,"preserve_path":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.routeseam.com/api/v1/domains \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: <X-Api-Key>' \ --data '{ "hostname": "old.com", "destination": "https://new.com", "status_code": 308, "preserve_path": true }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Destination URL; normalized server-side.
Example
{ "hostname": "old.com", "destination": "https://new.com", "status_code": 308, "preserve_path": true}Responses
Section titled “Responses”Created — dns instructions included until active
object
object
E.g. issued / failed
Present while status is not active — the record to add
object
ROUTESEAM_IP
Example
{ "domain": { "status": "pending_dns", "dns": { "type": "A", "name": "@" } }}Missing or invalid API key
The ONLY error envelope — produced by Api::V1::BaseController#render_error_response
object
object
Example
{ "error": "Invalid API key", "errors": [], "validation_errors": {}}API access requires a paid plan; org suspended; or owner email unverified
The ONLY error envelope — produced by Api::V1::BaseController#render_error_response
object
object
Examplegenerated
{ "error": "example", "errors": [ "example" ], "validation_errors": { "additionalProperty": [ "example" ] }}Hostname already taken (by any organization)
The ONLY error envelope — produced by Api::V1::BaseController#render_error_response
object
object
Example
{ "error": "Hostname is already taken", "errors": [], "validation_errors": {}}Validation failed (validation_errors keyed by attribute)
The ONLY error envelope — produced by Api::V1::BaseController#render_error_response
object
object
Examplegenerated
{ "error": "example", "errors": [ "example" ], "validation_errors": { "additionalProperty": [ "example" ] }}Over 300 requests/minute for this key
The ONLY error envelope — produced by Api::V1::BaseController#render_error_response
object
object
Example
{ "error": "Rate limit exceeded", "errors": [], "validation_errors": {}}