Skip to content

Domains

Account Scope Required, please include X-Auth-Account header with your Account ID.

All domains will be routed through our high performance CDN provider, bunny. Each domain can be connected by changing your nameservers, or by setting a cname record.


List all domains for a site

GET /api/sites/:site_id/domains

Returned Params
  • domains: Array
    • id: String
    • hostname: String
    • dns_zone: Object | associated dns zone
      • id: String
      • name: String
      • dnssec: Boolean
      • dnssec_data: Object (nil if dnssec = false)
      • created_at: DateTime
      • updated_at: DateTime
      • account: Object
        • id: String
        • name: String
    • dns_zone_records: Array | associated dns records
      • id: String
      • record_type: Integer
      • ttl: Integer
      • value: String
      • name: String
      • priority: Integer
      • weight: Integer
      • port: Integer
      • flags: String
      • record_type: Integer
      • comment: String
      • created_at: DateTime
      • updated_at: DateTime

Create a Domain

POST /api/sites/:site_id/domains

If no domain exists for a site, this will be automatically configured as the primary domain.

Params
  • domain: String
  • provision_method: String | options are: dns or cname.
Returned params for DNS
  • id: String
  • ns1: String
  • ns2: String
Returned params for cname
  • id: String
  • cname: String

Promote a domain

PATCH /api/sites/:site_id/domains/:id

This takes no parameters and will promote the requested domain to the primary domain. The existing primary domain will become an alias.


Remove

This will remove the domain. If it is the primary domain, the site will be updated to use the default temporary url. It's recommended to first promote your new domain to the primary domain before deleting it.

DELETE /api/sites/:site_id/domain/:id