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 |
formatted_url | string | Read-only field that formats the domain, base directory and scheme (i.e. |
domain | string | The domain part of the |
subdomain | string | The subdomain part of the |
https | boolean | Toggle for enabling SSL for the site |
hash | string | Read only and auto-assigned unique hash for the site. Used in |
published | boolean | Toggle for setting the site to a published state. A setting of |
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 | |
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 |
header_code | string | Extra HTML to add to all the site's pages right before the ending |
linklists | list | configuration of the Site's navigation menus |
logo | object | fully expanded |
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 |
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 |
|
| Filter for sites created on a particular date in |
|
| Filter for sites associated with a particular |
|
| Return sites based on if they are active ( |
|
| Searching by domain/subdomain similar to how you pass formatted_domain on Site creation |
|
| Filter for sites associated with a particular |
|
| Set the field to sort the results by. Available |
|
| 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