Create a domain

Creates a backup for a site.

POST
https://portal.onyx.io/api/v2/sites/{site}/domains

If successful, this endpoint will return a 200 OK status.

Arguments

The following arguments are supported for this endpoint.

Name Type Default Value

site Required

Site Lookup None

name Required

The name of the domain

String None

redirect

Would you like to redirect all requests to this domain to your primary domain?

Boolean None

create_alternative

Create www and bare domain versions?

Boolean None

Potential Errors

The following errors may occur during this request.

Details HTTP status

site_not_found

No site was found matching any of the criteria provided in the arguments

404 Not Found

validation_error

A validation error occurred with the object that was being created/updated/deleted

422 Unprocessable Entity

Returned Object

When the request is successful, you can expect an object matching the specification below to be returned.

{
    domain: Domain {
        id: Integer
        site_id: Integer
        name: String
        redirect: Boolean
        require_ssl: Boolean
        primary: Boolean
        created_at: Unix Timestamp
    }
}