publishSite( )


Publishes a site.

Publishing a site makes any changes previously saved on the site available on the internet. After publishing, changes to your site appear in the site's history.

When you call this API, you must pass a header called wix-site-id whose value is the ID of the site you want to publish. Learn more about working with API keys and site IDs.

Important: This call requires an account level API key and cannot be authenticated with the standard authorization header.

Method Declaration
Copy
function publishSite(): Promise<void>;
Request
This method does not take any parameters
JavaScript
import { createClient, ApiKeyStrategy } from "@wix/sdk"; import { siteActions } from "@wix/site-actions"; const wixClient = createClient({ modules: { siteActions }, auth: ApiKeyStrategy({ siteId: "MY-SITE-ID", apiKey: "MY-API-KEY", }), }); async function publishSite() { const response = await wixClient.siteActions.publishSite(); }
Errors
428Failed Precondition

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?