Get sites
GET /sites
List all sites owned by account holders in the API consumer’s brand. Optionally, filter the response by searching for a string, and returning only sites that have a mapped domain that contains this string.
By default, only 10 sites will be returned in the response, always starting with the first site created. You can change this behaviour by using the limit and offset parameters. Typically, deleted sites are not included in the response. If you want to include these sites then set the deleted parameter.
Parameters
brandRef integer | Required. Retrieve sites for this brand |
domain string | Return only sites that have a mapped domain that contains this string. |
limit integer | Set the number of sites that will be returned in the response. By default, only 10 sites will be returned. |
offset integer | Set the offset to the first site to be returned in the response. By default, the first site will be returned. |
deleted integer | Include sites in the response that have been soft deleted. By default, deleted sites will not be included. |
Response
Get site
GET /sites/:siteRef
Response
Create a site
POST /sites
Create a new site for the specified account holder. The site must be created in the caller’s brand.
Typically, an account holder will only have one site, but they may have multiple sites. The new site will be created regardless of the number of sites that the account holder is able to publish.
To login a user to one of the sites in their account, see Login User.
Input
accountHolderRef integer | Required. Account holder the site belongs to. |
brandRef integer | Required. Brand to create the site on. |
domain string | Required. Domain name used to access the site. The domain must have DNS mapped to the environment on which the site is being created. More domains can be added via Map Domain to Site. Max length: 255 characters. |
templateRef integer | Template to use on the site. If not provided, the site will have a default template. |
activationStatus string | Can be set to active or inactive . If the site’s brand activationURL is set and the site has an inactive activationStatus, clicking the publish button in the editor will result in a redirect to the aforementioned URL. |
siteType string | Can be set to desktop or responsive . If you’re unsure of this value, ask your account manager for more information. |
Content-Type: application/json
Response
Status: 201 Created
Edit site
PUT /sites/:siteRef
This will only update the properties that have been included in the request. All properties that are missing from the request will remain the same.
Input
primaryUrlRef integer | Domain to set as primary. |
live integer | Setting to 1 will make a previously published site accessible. Setting to 0 will make a previously published site inaccessible. |
templateRef integer | Template to be used by the site |
activationStatus integer | Can be active or inactive . If the site’s brand activationURL is set and the site has an inactive activationStatus, clicking the publish button in the editor will result in a redirect to the aforementioned URL. |
protocol string | Can be http or https . If it is configured as https it will force redirection to https. It does not provision a certificate. |
alwaysRedirectToPrimaryDomain integer | Can be 0 or 1 . Setting to 1 will redirect all of the site’s domains to the primary domain. |
Content-Type: application/json
Response
Status: 200 OK
Delete site
DELETE /sites/:siteRef
The site’s database is not deleted, but it is marked for deletion and will not be included in further API calls unless deleted sites are explicitly requested.
Response
Status: 204 No Content
Hard delete site
POST /sites/:siteRef/hard-delete
The site database plus all related site records and data are permanently deleted. Use with caution as there is no way to recover site data after this call.
This endpoint is available from v44 onwards.
Response
Status: 204 No Content
Publish site
POST /sites/:siteRef/publish
Note: Available from 7.42 onwards.
Response
Status: 200 OK
Reset site
POST /sites/:siteRef/reset
Removes all site content.
Response
Status: 204 No Content
Map domain to site
POST /sites/:siteRef/domains
Add a domain mapping to a site. Any subsequent requests to this domain will resolve to the site.
Note that the domain’s DNS needs to point to the site’s environment. For more details about the DNS settings you need, please contact integrations@basekit.com.
Input
domain string | Map this domain to the specified site. |
Content-Type: application/json
Response
Status: 201 Created
Unmap domain from site
DELETE /sites/:siteRef/domains/:domainRef
Remove a domain mapping from a site. The domain is completely removed and will no longer be mapped to any site.
Note that if the DNS for the unmapped domain is unchanged then any subsequent requests to this domain will resolve to a holding page.
Response
Status: 204 No Content
Create page
POST /sites/:siteRef/pages
Add a page to a site.
Input
pageUrl string | Path of page in URL. |
type string | Page type. Set as page . |
title string | Title of the page. |
status string | Page status. Can be active , inactive , or draft . |
Content-Type: application/json
Response
Status: 200 OK
Create widget
POST /sites/:siteRef/widgets
Adds a widget to a page on a site.
Input
collection string | Create the widget as part of this collection. For responsive sites creating widgets inside the main zone, this should be widgets . |
name string | Widget name. Must be unique inside the parent. |
parentId string | ID of the parent widget. For responsive sites this will typically need to be page-zones__main . |
type string | Widget type. |
pageRef string | Page to create the widget on. |
position string | Zero based position of the widget inside the parent. Defaults to 0 if not specified. |
values string | Associative array of initial values for the widget. |
Content-Type: application/json
Response
Status: 200 OK
Get global values
GET /sites/:siteRef/global-values
Note: Available from 7.45 onwards.
Site global values are global properties of the site. For example headScript
or bodyScript
. See the global value reference for a list of properties.
Response
Status: 200 OK
Add global value
POST /sites/:siteRef/global-values
Note: Available from 7.45 onwards.
Input
name string |
value string |
Content-Type: application/json
Response
Status: 201 Created
Update global value
PUT /sites/:siteRef/global-values/:name
Note: Available from 7.45 onwards.
Input
value string |
Content-Type: application/json
Response
Status: 200 OK
Get all the static widget values for a site
GET /sites/:siteRef/static-values
Site static values are properties that affect template widgets on a site. For example a content widget may have a staticWidgetId of content-contacttitle
with a named property of showTplWidget
that determines whether to hide or show the widget in that template.
Response
Status: 200 OK
Get a specific widgets static value for a site
GET /sites/:siteRef/static-values/:staticWidgetId
This retrieves a specific static widget value, using the staticWidgetId
Response
Status: 200 OK
Update site widgets static value
PUT /sites/:siteRef/static-values/:staticWidgetId
Input
name string |
value string |
Content-Type: application/json
Response
Status: 200 OK