Sites
Sites
The Sites resource is the primary way of publishing and managing any sites, landing pages or any other normal web experiences within the platform.
Site model
Site object
A site object contains the following fields
Attribute
Type
Description
id
integer
unique id of the site
business_id
integer
Reference id to the Business this site is assigned to
business
object
The full Business object expanded
locations
list
List of the assigned Location objects to the site
user_id
integer
Reference id to the User that created this site
deleted
boolean
Field that denotes if the site is disabled or not
base_directory
string
For landing pages, the directory that the page will be published
formatted_domain
string
The hostname/domain where the site is published, including the domain and subdomain (i.e www.example.com
)
formatted_url
string
Read-only field that formats the domain, base directory and scheme (i.e. https://www.example.com/
)
domain
string
The domain part of the formatted_domain
(i.e. example.com
)
subdomain
string
The subdomain part of the formatted_domain
(i.e. www
)
https
boolean
Toggle for enabling SSL for the site
hash
string
Read only and auto-assigned unique hash for the site. Used in preview_url
published
boolean
Toggle for setting the site to a published state. A setting of false
(default) will return a 404 if visited on the formatted_url
preview_url
string
Preview URL for this site. Should always be available regardless of published status
title
string
This is the internal name of the site displayed in the site editor user interfaces. Does not show on the published site
custom_fields
object
Custom field values assigned to the site
theme_settings
object
Assigned theme settings values. Support for these values is dependent on the theme
partner_site_id
string
Unique ID reference to partner IDs
language_code
string
The default language (plus specific region) for the site. Similar to the values that browsers send. Examples: en
, en-us
theme_id
integer
The assigned Theme object used by the site
disable_analytics_events
list
List of events to disable automatic tracking of
noindex
boolean
Toggle to set the site as non-indexable by search engines
extra_css
string
Extra CSS to add to all the site's pages
footer_code
string
Extra HTML to add to all the site's pages right before the ending </body>
tag
header_code
string
Extra HTML to add to all the site's pages right before the ending </head>
tag
linklists
list
configuration of the Site's navigation menus
logo
object
fully expanded Logo
object
plugins
object
Active site plugins enabled for this site
added
timestamp
Date and time site was created
modified
timestamp
Date and time site was modified
asset_url_prefix
string
Base URL that will be used to prefix static assets. This can be used to enable a CDN for serving these files.
screenshot_thumbnail
string
Link to a thumbnail image preview of the site's homepage
ssl_last_updated
string
Timestamp of when the site's SSL was last updated
www_primary
boolean
Determines if the site should be published prefixed by www.
or not
vanity_domain
string
Ability to set a domain, that if pointed, will redirect to this Site
Example object:
Custom fields
Each site that is built on the platform can be assigned custom_fields
values that can then be used throughout templates and pages.
This field can contain a structured JSON object with support for nested values.
From this example, the value can be used in templates via either the macro ($custom_headline_one
) or via template variable ({{ site.custom_fields.headline_one }}
). More examples here.
Create a site
POST /api/v2/sites/
Required fields
Attribute
formatted_domain
theme_id
title
List sites
List all sites including active, deleted, non-published and published
List all active sites
Parameters
Name
Type
Description
added__date
string
Filter for sites created on a particular date in YYYY-MM-DD
format
business_id
string
Filter for sites associated with a particular Business
deleted
string
Return sites based on if they are active (0
) or deleted/disabled (1
)
formatted_domain
string
Searching by domain/subdomain similar to how you pass formatted_domain on Site creation
location_id
string
Filter for sites associated with a particular Location
order_by
string
Set the field to sort the results by. Available order_by
includes id
(default) and title
. You can also sort decending by prefixing the field with a minus sign (i.e. order_by=-id
)
partner_site_id
string
Used to lookup/search for sites matching a particular internal id
Response
Get a single site
Fetch the Site detail using the Site.id
Updating a site
You can PUT
a partial or full object to the detail endpoint to update/change values on the Site object. If using a partial object, you must insure that the primary site id
is part of the payload.
Disabling / enabling a site
Disabling a site
To disable an active site and clear all cache references to the domain, use the DELETE
method on the Site detail endpoint.
Enabling a site
To enable a currently disabled site, you will set the param for deleted
to False
using the Site update endpoint.
Last updated