palbaseDocs

Palbase Machines · API

POST/sites/{name}/domains

Add a domain to a site

Adds a domain of the customer's own the site answers at too, once its owner has added the records the answer names to its DNS. Refused when another environment has it (domain_taken), when it is one of the platform's, or past the project's domains, every environment's together: twenty on Free, a hundred on Pay as you go (too_many_domains).

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.

Request body

hoststring · requiredThe domain: www.example.com, or example.com — none of the platform's own.
redirect_tostring · optionalAnother domain of the same site or machine, added before, its visitors are sent to (an apex to its www, or a www to its apex). It may not redirect itself, and this one may not be another's target.
redirect_status301 | 302 | 307 | 308 · optionalThe redirect's status, with redirect_to: 308 unless said.
curl
curl -X POST "https://<your-ref>.palbase.studio/sites/<name>/domains" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"host":"string"}'

Responses

201The domain, pending

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

409The project already has a machine of this name, or has as many machines as it may

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 AddSiteDomain of machines's contract.