Palbase Machines · API
/sites/{name}/domains/{host}Set where a site's domain redirects
Sends the domain's visitors to another domain of the same site — the same path and query there, with redirect_status (308 unless said) — or, redirect_to null, has it answer itself. It holds at the edge at once. A domain redirects to one that redirects nowhere, and one others redirect to answers itself.
Called by your server, with the project's secret key.
Path
namestring · requiredThe site's name: lowercase letters, digits and dashes, starting with a letter and not ending with a dash, 32 at most.hoststring · requiredThe domain.Request body
redirect_tostring · requiredAnother domain of the same site or machine (one that redirects nowhere itself), or null.redirect_status301 | 302 | 307 | 308 · optionalThe redirect's status, with redirect_to: 308 unless said.curl -X PATCH "https://<your-ref>.palbase.studio/sites/<name>/domains/<host>" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"redirect_to":"string"}'Responses
200The domain
400Validation failed or a required field is missing
401Missing or invalid API key
403Not the project's secret key
404The project has no site of this name
429Over the project's request limit, or its machine time for this period is used up
503Temporarily unavailable; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation UpdateSiteDomain of machines's contract.