Does any one know how to apply the custom site design to the team site collection URL in SharePoint online through client side object model?

2 Answers 2


You need to use the ApplySiteDesign method of the Tenant class.

In that method, you need to pass the site design's Id. For that you first need fetch the site Design id that you want to apply and then use the ApplySiteDesign method to execute the site design on the site collection.

The code for that would be as below:

var tenantUrl = "https://<tenant>-admin.sharepoint.com";

var tenantContext = new ClientContext(tenantUrl));

var tenant = new Tenant(tenantContext);

var existingDesigns = tenant.GetSiteDesigns();

var existingSiteDesign = existingDesigns.FirstOrDefault(d => d.Title == "Your-site-design-name");

var results = tenant.ApplySiteDesign("<your-site-collection-url>", existingSiteDesign.Id);

If there are >30 actions, you can se SiteDesignTask as below:

var designTask = tenant.AddSiteDesignTask(tenantContext, "<your-site-collection-url>", existingSiteDesign.Id);

References -



You need to be atleast SharePoint admin to execute this code, being a site collection admin alone is not sufficient if you want to do that via CSOM.

  • Thank you.. Gautam, its worked.
    – taruki_MS
    Jul 1, 2020 at 5:11
  • Gautam ..It is working if site design have total of 30 verbs/actions (including sub-actions) but not above 30 verbs/action. Do you've an idea how to apply the large site design via CSOM?
    – taruki_MS
    Jul 1, 2020 at 10:57
  • Updated for >30 actions. Jul 1, 2020 at 11:09
  • great.. it's worked.. thank you :)
    – taruki_MS
    Jul 2, 2020 at 5:35

Using CSOM, you can use tenant.applySiteDesign(). You need to pass the web URL and site design ID to this method.


public ClientObjectList<TenantSiteScriptActionResult> ApplySiteDesign(
    string webUrl,
    Guid siteDesignId

Official documentation can be found here:

Tenant.ApplySiteDesign method

Also, you can get complete code at: The Ultimate Guide to SharePoint Site Designs and Site Scripts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.